[twitter-dev] Re: http://twitter.com/direct_messages/new.json failed
On Fri, Apr 10, 2009 at 12:25, Doug Williams wrote: > Gary, > direct_messages/new requires a HTTP POST request. I can see from the URL you > pasted in the post that you have a query string. If you are sending a POST > request you would have no query string. Although, it is possible to have a POST with a query string, and doing so will generate the 401 error, even if it's a POST with a valid body. Took me a while to realize this is what was happening. Zac
[twitter-dev] Re: http://twitter.com/direct_messages/new.json failed
Exactly. It's my overlook. Thanks Alex and Doug. On Fri, Apr 10, 2009 at 9:25 AM, Doug Williams wrote: > Gary, > direct_messages/new requires a HTTP POST request. I can see from the URL > you pasted in the post that you have a query string. If you are sending a > POST request you would have no query string. > > Doug Williams > Twitter API Support > http://twitter.com/dougw > > > > On Thu, Apr 9, 2009 at 10:21 PM, Alex Payne wrote: > >> >> 400 is the response code we return for rate limiting. Are you sure >> you're making the request using an HTTP POST? What was the body of the >> response? >> >> On Thu, Apr 9, 2009 at 18:22, Gary Zhao wrote: >> > http://twitter.com/direct_messages/new.json?user=qinqi7&text=test >> > I got "The remote server returned an error: (400) Bad Request." Anything >> > wrong with this API invocation? >> > Thanks >> > >> > -- >> > Gary >> > http://twitter.com/garyzhao >> > >> >> >> >> -- >> Alex Payne - API Lead, Twitter, Inc. >> http://twitter.com/al3x >> > > -- Gary http://twitter.com/garyzhao
[twitter-dev] Re: http://twitter.com/direct_messages/new.json failed
Gary, direct_messages/new requires a HTTP POST request. I can see from the URL you pasted in the post that you have a query string. If you are sending a POST request you would have no query string. Doug Williams Twitter API Support http://twitter.com/dougw On Thu, Apr 9, 2009 at 10:21 PM, Alex Payne wrote: > > 400 is the response code we return for rate limiting. Are you sure > you're making the request using an HTTP POST? What was the body of the > response? > > On Thu, Apr 9, 2009 at 18:22, Gary Zhao wrote: > > http://twitter.com/direct_messages/new.json?user=qinqi7&text=test > > I got "The remote server returned an error: (400) Bad Request." Anything > > wrong with this API invocation? > > Thanks > > > > -- > > Gary > > http://twitter.com/garyzhao > > > > > > -- > Alex Payne - API Lead, Twitter, Inc. > http://twitter.com/al3x >
[twitter-dev] Re: http://twitter.com/direct_messages/new.json failed
400 is the response code we return for rate limiting. Are you sure you're making the request using an HTTP POST? What was the body of the response? On Thu, Apr 9, 2009 at 18:22, Gary Zhao wrote: > http://twitter.com/direct_messages/new.json?user=qinqi7&text=test > I got "The remote server returned an error: (400) Bad Request." Anything > wrong with this API invocation? > Thanks > > -- > Gary > http://twitter.com/garyzhao > -- Alex Payne - API Lead, Twitter, Inc. http://twitter.com/al3x