You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sent request does either not contain the request parameter 'id' or it is invalid (e.g. wrong format).
The call from API returns this error. Upon further inspection, I found that this is caused by the buildRequestUrl method which uses http_build_query function which by default uses '&' as a separator. Normally if posting to another php5.3 machine this will not be a problem.
But if you post to a server with a newer PHP version or tomcat java server or something else the & might not be handled properly.
To overcome this specify:
http_build_query($array, '', '&');
and NOT
http_build_query($array);
in buildRequestUrl method. More specifically, change buildRequestUrl method in ApiClient.php to the following:
/**
* Returns the request url.
*
* @param string $path the request path
* @param array $queryParams an array of query parameters
* @return string
*/
private function buildRequestUrl($path, $queryParams) {
$url = $this->getBasePath() . $path;
if (!empty($queryParams)) {
$url = ($url . '?' . http_build_query($queryParams, '', '&'));
}
return $url;
}
The text was updated successfully, but these errors were encountered:
I have created a new release which fixes the issue. However the underlying problem is actually that you can override the arg-separator.output via the PHP ini. So the solution remains the same but it is not happening randomly and it has actually not that much to do with the remote server.
Pull request: #3
The call from API returns this error. Upon further inspection, I found that this is caused by the buildRequestUrl method which uses http_build_query function which by default uses '&' as a separator. Normally if posting to another php5.3 machine this will not be a problem.
But if you post to a server with a newer PHP version or tomcat java server or something else the & might not be handled properly.
To overcome this specify:
http_build_query($array, '', '&');
and NOT
http_build_query($array);
in buildRequestUrl method. More specifically, change buildRequestUrl method in ApiClient.php to the following:
The text was updated successfully, but these errors were encountered: