![]() |
CURL Request Class - urlencode - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: CURL Request Class - urlencode (/showthread.php?tid=91486) |
CURL Request Class - urlencode - 68thorby68 - 08-17-2024 Hi, I working with a 3rd Party API and need to configure the URL as per the 3rd party spec. PHP Code: $my_row = $client->get('/THIRDPARTY/?filter__Company%20Name__equal=my%20company%20(sports%20department) However, CURL Request Class encodes the url to: Code: GET /THIRDPARTY/?filter__Company_Name__equal=my+company+%28sports+department%29 I can't see anything obvious in the documentation and the only setting I can find in Config->CURLRequest is PHP Code: public $shareOptions = true; RE: CURL Request Class - urlencode - kenjis - 08-17-2024 (08-17-2024, 09:58 AM)68thorby68 Wrote: Is there a way to instruct the CURL Request Class not to encode the url? No. Use `query` option to send a request with query string. https://codeigniter.com/user_guide/libraries/curlrequest.html#query RE: CURL Request Class - urlencode - 68thorby68 - 08-18-2024 (08-17-2024, 06:58 PM)kenjis Wrote:(08-17-2024, 09:58 AM)68thorby68 Wrote: Is there a way to instruct the CURL Request Class not to encode the url? Many thanks kenjis, with logging, my request is now and works perfectly, Thank you My code new reads: PHP Code: $update_row = $client->request('GET','/THIRDPARTY/', Code: GET /THIRDPARTY/?user_field_names=true&filter__Company+Name__equal=my+company+%28sports+department%29 Just to note, when I use the format PHP Code: $update_row = $client->get('/THIRDPARTY/?user_field_names=true&filter__Company Name__equal=my company (sports department), Code: GET /THIRDPARTY/?user_field_names=true&filter__Company_Name__equal=my+company+%28sports+department%29 Again many thanks. |