class ApiCall {
public function __construct( Client $urlFetcher, ) {
$this->urlFetcher=$urlFetcher;
$this->apiCallUrl='/example';
}
public function callApi(){
$result=$this->urlFetcher->request('GET',$url,[ "query" => $urlParams ]);
}
}
Then when I try to call the callApi of the class above I get an exception with the following error message:
Client error: GET http://example.com/example resulted in a 405 Method Not Allowed response:
{"name":"MethodNotAllowed","message":"Wrong api Call"}
AThat means that the base_url ignores the /v1/ part of the base url. Wouldn't be a good idea to somehow include it when I perform the api call or tell to use the full url?
During the Bundle usage I have the following url in order to use for my api http://example.com/v1/. But if I set the following config:
And then I use the following code:
Then when I try to call the
callApi
of the class above I get an exception with the following error message:AThat means that the base_url ignores the
/v1/
part of the base url. Wouldn't be a good idea to somehow include it when I perform the api call or tell to use the full url?