Getting 405 Method Not Allowed error on POST request.. Please help.

1,245 views
Skip to first unread message

Aditya Hajare

unread,
Jun 12, 2011, 12:13:32 AM6/12/11
to opensoci...@googlegroups.com
I am using orkut osapi PHP client library... i did not changed anything in it yet.. just specified required credentials in global.php and tried to test the client..
At first, it was giving me Content-Length header is missing error.. I fixed it by manually adding Content-Length: 0 header in it's send() function which makes the CURL calls...
Now it is giving me 405 Method Not Allowed error...
Bellow is the POST request response i have received :

[http_code] => 405
[data] => HTTP/1.1 405 Method Not Allowed
Content-Type: text/html; charset=UTF-8
Content-Length: 12463
Date: Sun, 12 Jun 2011 04:10:35 GMT
Server: GFE/2.0

I am using orkut php client library located at : http://code.google.com/p/orkut-os-client-php/downloads/list
If someone knows what's going wrong in there, please let me know..!!

Regards
Aditya Hajare

Robson Dantas

unread,
Jun 13, 2011, 6:52:09 AM6/13/11
to opensoci...@googlegroups.com
Hi !

There is a bug on php-curl when specifying CURL_CUSTOMREQUEST. What you have to do in this case is removing this line on orkut-3legged.php:

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);

Most servers people in India use, like hostgator, have this bug. Give it a try and let me know.

Robson Dantas
@robsondantas

--
You received this message because you are subscribed to the Google Groups "orkut Developer Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/opensocial-orkut/-/lQtbgAFC_7IJ.
To post to this group, send email to opensoci...@googlegroups.com.
To unsubscribe from this group, send email to opensocial-ork...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/opensocial-orkut?hl=en.

Aditya Hajare

unread,
Jun 13, 2011, 9:02:37 AM6/13/11
to opensoci...@googlegroups.com
Hello,
Thank you for replying but i am still getting the same 405 error even after removing that line from the send() function located in orkut-3legged.php.
Following are the details from curl response :

[http_code] => 405
[data] => HTTP/1.1 405 Method Not Allowed
Content-Type: text/html; charset=UTF-8
Content-Length: 12462
Date: Mon, 13 Jun 2011 12:56:54 GMT
Server: GFE/2.0

Following are the headers which are being passed to curl request :

[headers] => Array
(
[0] => Authorization: OAuth oauth_nonce="568f3be5543gfd54k4bec7aedb1db3f", oauth_version="1.0", oauth_timestamp="1306759808", oauth_consumer_key="www.adiinviter.com", oauth_token="1%2F_-AoHtAgyfd8SGdf36yBVtL-01kTs35438cU0cc32uQFOZ0", oauth_body_hash="7X4muhpGGHoXjRI3iaH%2FczTC2EQ%3D", oauth_signature_method="HMAC-SHA1", oauth_signature="jgZEpzKF%2BCkHAyRyqAMRzK7HtpU%3D"
[1] => Content-Type: application/json
[2] => Content-length: 0
)

And yes i am hosted on hostgator server.
Kindly help.

Regards
Aditya Hajare

Aditya Hajare

unread,
Jun 13, 2011, 11:24:33 PM6/13/11
to opensoci...@googlegroups.com
The post request is being submitted to following url : http://www.orkut.com/social/rpc/
The scope parameter in oAuth request is : http://orkut.gmodules.com/social/
Reply all
Reply to author
Forward
0 new messages