knowramphp Posted March 30, 2017 Share Posted March 30, 2017 I am having trouble getting a Curl script to work for a GET request. if I use the following as the URL everything works. curl_setopt($ch, CURLOPT_URL, 'https://10.10.10.10/vmrest/users'); However if I try and add a query to filter out the results I get an error 505. Is there anything different I have to do to get CURLOPT_URL to format correctly when using the brackets and spaces? curl_setopt($ch, CURLOPT_URL, 'https://10.10.10.10/vmrest/users?query=(dtmfaccessid startswith +1214820)'); Thanks in advance. Link to comment Share on other sites More sharing options...
requinix Posted March 30, 2017 Share Posted March 30, 2017 Construct a valid URL with something like http_build_query: curl_setopt($ch, CURLOPT_URL, 'https://10.10.10.10/vmrest/users?' . http_build_query(['query' => '(dtmfaccessid startswith +1214820)'])); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.