Hello,
Thanks for this module. I have used it successfully as a client for my custom Oauth implementation. However, there's some problem with the get method(DrupalOauthClient::get) when the HTTP method is set to POST. The problem is that at the endpoint, the server is not receiving the POST parameters. I did a simple test with drupal_http_request and it worked well.
A post at SO: http://stackoverflow.com/questions/4790413/php-curl-server-not-receiving... shows that this bit curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); shouldn't be there. I know you need it to send the Oauth params to the header, but is there an alternative way to achieve this without necessarily including the curl header options?
Thanks
Comments
Comment #1
drecute commentedI am subclassing DrupalOauthClient like this:
Comment #2
sunThe suggested solution is wrong. As also mentioned on SO, the cause is:
DrupalOAuthClient apparently sends the following, totally weird and invalid header:
whereas the type specified in Accept belongs into Content-Type. Accept signifies what response formats the client is able to handle.
...and then it goes on and makes it even worse...
I'm not sure why the code is using all of that custom cURL code to execute requests instead of drupal_http_request(). Unless there's a really good reason for doing so, it's going to be way easier to replace that entire code.
Comment #3
drecute commentedYes I agree that drupal_http_request is way easier, sun! I had to by-pass this bug in a subclass by writing a custom get function which uses drupal_http_request. here's what it looks like: