[twitter-dev] Re: OAuth Echo problem in python

2010-06-07 Thread Steve C
If you were seeing a 400 Bad Req, you were most likely sending a bad upload to the API. We only return a 400 Bad Req if the image is not found, the multipart form-data is malformed, or if the image is 5MB. If Twitpic is having a service outage you will always get a 50x error (502 or 500). If

[twitter-dev] Re: OAuth Echo problem in python

2010-06-04 Thread noki
Hi, I also stacked on the TwitPic's OAuth Echo Protocol a week ago. The point was making header just like to request Twitter. 1. make OAuth Header to request Account/Verify_credentials to get JSON not XML as result by GET method. 2. insert this header into X-Verify-Credentials-Authorization

[twitter-dev] Re: OAuth Echo problem in python

2010-06-04 Thread noki
Ah, I forgot to include my blog URL. http://postcard.blog.ocn.ne.jp/itazura/2010/05/twitpic_api_v2_.html This was written in Japanese but you will find code to upload.

Re: [twitter-dev] Re: OAuth Echo problem in python

2010-06-04 Thread Yann Malet
Hello Zac, I rewrote everything in my app based on python-oauth2 : http://dpaste.com/203168/ The file is still hardcoded to ease the comprehension. I hope this will help you to spot my issue. The error message I get from twitpic is 400 bad request. Regards, --yml class

Re: [twitter-dev] Re: OAuth Echo problem in python

2010-06-04 Thread Yann Malet
If I send this request to 127.0.0.1:9000 without the file here it is the string I can observe : (ve)y...@yml-laptop:jess3$ netcat -l -p 9000 POST / HTTP/1.1 Accept-Encoding: identity Content-Length: 377 X-Auth-Service-Provider: https://api.twitter.com/1/account/verify_credentials.json Host:

[twitter-dev] Re: OAuth Echo problem in python

2010-06-04 Thread Steve C
Twitpic will only 400 Bad Request you if it can't find the image in your multipart/form- data or if the image is invalid (not jpg/png/gif or 5MB in size). Thanks, Steve C Twitpic On Jun 4, 9:20 am, Yann Malet yann.ma...@gmail.com wrote: If I send this request to 127.0.0.1:9000 without the file

Re: [twitter-dev] Re: OAuth Echo problem in python

2010-06-04 Thread Yann Malet
Steve, The image is only 33.7kb and it is a jpg. Do you have any python sample code for the ? Regards, --yml On Fri, Jun 4, 2010 at 9:38 AM, Steve C st...@twitpic.com wrote: Twitpic will only 400 Bad Request you if it can't find the image in your multipart/form- data or if the image is

Re: [twitter-dev] Re: OAuth Echo problem in python

2010-06-04 Thread Yann Malet
I have just uploaded the same image using the web interface : http://twitpic.com/1ttrlu http://twitpic.com/1ttrludo you have any recommendation ? On how to solve this issue. http://twitpic.com/1ttrluRegards, --yml On Fri, Jun 4, 2010 at 9:56 AM, Yann Malet yann.ma...@gmail.com wrote: Steve,

[twitter-dev] Re: OAuth Echo problem in python

2010-06-04 Thread yml
At that point both services yfrog and twipic work fine. I hate to say this but I am almost convince that the pain in the development process comes from some outage in either twitpic or Twitter Oauth Echo authentication. for the sake of completeness of this thread here it is my 2 working views :

[twitter-dev] Re: OAuth Echo problem in python

2010-06-03 Thread yml
I would greatly appreciate any help. Here it is the latest evolution of this piece of code : class TwitpicOAuthRequest(OAuthRequest): def to_header(self, realm='http://api.twitter.com/'): headers = super(TwitpicOAuthRequest, self).to_header(realm=realm) return

[twitter-dev] Re: OAuth Echo problem in python

2010-06-03 Thread Steve C
I just looked at your code briefly, but I believe the problem is this line: oauth_request = TwitpicOAuthRequest(http_method=POST, http_url=settings.TWITPIC_API_URL, The OAuth Request needs to be signed using the Twitter Endpoint (https://api.twitter.com/1/account/verify_credentials.json), not

Re: [twitter-dev] Re: OAuth Echo problem in python

2010-06-03 Thread Yann Malet
Thanks Steve for your reply but has you could see in the second code snippet I have posted i have changed this from POST to GET without much success. I had also replaced the http_url has you suggest. One of my question is how does the file should be sent in the ? multipart_encode or urlencode

Re: [twitter-dev] Re: OAuth Echo problem in python

2010-06-03 Thread Zac Bowling
It may not help fix your problem but I would recommend upgrading to the python-oauth2 library. (Don't be confused by the name; it's not an oauth 2.0 library, but just the next generation of the original oauth 1.0a library that Leah Culver wrote). There are bunch of little issues with the

Re: [twitter-dev] Re: OAuth Echo problem in python

2010-06-03 Thread Yann Malet
Zac, I would love to do this but I can't find any documentation on how to do Oauth Echo with python-oauth2. I would gladly switch to python-ouath2 if I could find some code showing How to use it to post a picture on twitpic : http://dev.twitpic.com/docs/2/upload/

Re: [twitter-dev] Re: OAuth Echo problem in python

2010-06-03 Thread Zac Bowling
Hi Yann, I don't see anything obvious that stands out as wrong to me in your implementation from just looking at it, but I'm not sure. I do have OAuth Echo code working for Twitpic but using the OAuth2 library. If you don't figure out an answer, you can hit me up off the list and I'll see if I