Closed mrtnmueller closed 10 years ago
hm, after a moment of thinking i claim changing
default:
if (isset($this->request_settings['postfields'])){
curl_setopt($c, CURLOPT_CUSTOMREQUEST, $this->request_settings['postfields']);
to
default:
if (isset($this->request_settings['querystring']))
$this->request_settings['url'] = $this->request_settings['url'] . '?' . $this->request_settings['querystring'];
curl_setopt($c, CURLOPT_CUSTOMREQUEST, $this->request_settings['method']);
might actually solve all remaining cases.
merged into 0.8.4 and master.
When working with the Xing API I encountered a problem with tmhOAuth. I think I got the same problem on twitter, but there the DELETE can be replaced with a POST request so I didn't really care.
However, here is the problem: DELETE requests will never be sent. Instead, a GET request will be performed.
for example:
$this->tmhOAuth->request('DELETE', $this->tmhOAuth->url('v1/activities/'.$artifactId), array('id' => $artifactId));
will produce the following request header:The problem is in function curlit(). Here are 2 cases: GET and POST. For all other requests, CURLOPT_CUSTOMREQUEST is set, but the request method is wrongly set to an array ($this->request_settings['postfields']) and url parameters are not considered.
SOLUTION: Add another case to curlit():
Same will probably go for PUT, I didn't test it though.