Hello Matt, I've try the case without basic Auth, but still 401
http://9.share.photo.xuite.net/u9011022/19d3103/4424859/171517288_x.jpg On 12月1日, 上午9時57分, Matt Harris <thematthar...@twitter.com> wrote: > Hi Alvin, > > I notice in your request that you are sending a Basic Authentication header > in addition to the OAuth. Specifically the line: > Authorization: Basic ........ > > When using OAuth this is not required and will be confusing the request. > Specifically you are sending OAuth in the request but telling the API to > authorise using Basic Auth. What you should do is either drop the > Authorization header completley, or move the OAuth parameters into the > Authorization header. > > A possible reason why some of your requests are working and others are > failing is that some methods do not require authentication. In those cases > the failing authentication details you are sending are being ignored and the > request is most likely running unauthenticated. > > Best, > @themattharris > Developer Advocate, Twitterhttp://twitter.com/themattharris > > 2010/11/30 Alvin Wang <alvin0...@gmail.com> > > > > > > > > > Hey, > > > still same. > >http://9.share.photo.xuite.net/u9011022/19d31e2/4424859/171241799_x.jpg > > > On 11月30日, 上午2時39分, themattharris <thematthar...@twitter.com> wrote: > > > Hi Alvin, > > > > The error in that response tells me your signature is incorrect. > > > Double check you are generating your signature using the algorithm > > > described here: > > > http://dev.twitter.com/auth#signing-requests > > > > In particular I notice the parameters in your GET request are not in > > > lexicographical order, and so I wonder if they may not be in order in > > > your signature base string. > > > > Best, > > > Matt > > > > On Nov 24, 10:10 pm, Alvin Wang <alvin0...@gmail.com> wrote: > > > > > hello, Matt > > > > > After removing the symbol "&" and parameter realm, the frequency of > > > > 401 is lower. > > > > But it becomes the problem as I attach below > > > > >http://9.share.photo.xuite.net/u9011022/19d319b/4424859/170775808_x.jpg > > > > > On 11月25日, 上午2時32分, Matt Harris <thematthar...@twitter.com> wrote: > > > > > > Hey Alvin, > > > > > > Your URL looks badly formed as it includes > > > > > .../home_timeline.json?&count=5.... I would expect to see > > > > > .../home_timeline.json?count=5... > > > > > (so no & after the ?). You also have realm in your query string when > > it > > > > > isn't needed. Realm is optional and when used, is only used in the > > > > > Authorization header. When using OAuth in the query string you > > shouldn't > > > > > pass realm. Your parameters should also be in lexicographical order. > > > > > > In your case I would have expected your URL to look like this: > > >http://api.twitter.com/1/statuses/home_timeline.json?count=5&oauth_co... > > > > > &page=1 > > > > > > You can read more about signing requests on our developer resources > > site: > > > > > http://dev.twitter.com/pages/auth#signing-requests > > > > > > Best > > > > > @themattharris > > > > > Developer Advocate, Twitterhttp://twitter.com/themattharris > > > > > > 2010/11/23 Alvin Wang <alvin0...@gmail.com> > > > > > > > hello Matt, > > > > > > here is the image when 401 occurs. > > > > > > >http://dl.dropbox.com/u/162763/1.png > > > > > > > On 11月23日, 下午2時17分, Matt Harris <thematthar...@twitter.com> wrote: > > > > > > > Hey Alvin, > > > > > > > > So the community and developers can help you we'll need to know a > > little > > > > > > bit > > > > > > > more about the error you are receiving. Things like the API > > request you > > > > > > are > > > > > > > making, the request basestring, and the full response you get > > back are > > > > > > good > > > > > > > things to include. > > > > > > > > Be careful to not include any passwords or OAuth secrets in > > anything you > > > > > > > share. > > > > > > > > Best, > > > > > > > @themattharris > > > > > > > Developer Advocate, Twitterhttp://twitter.com/themattharris > > > > > > > > 2010/11/22 Alvin Wang <alvin0...@gmail.com> > > > > > > > > > Are there any other solutions? Retry will still got > > 401randomly. Just > > > > > > > > wondering is there any twitter tech person can help? > > > > > > > > > On 11月23日, 上午3時28分, Nick Bradbury <nick.bradb...@gmail.com> > > wrote: > > > > > > > > > I also ran into this problem, even though I knew the > > signature was > > > > > > > > > fine. This post from a Twitter "Developer Advocate" > > indicates that > > > > > > > > a401may be due to Twitter being stressed: > > >http://www.devcomments.com/re-intermittent-401-and-502-during-oauth-p... > > > > > > > > > > In my case, ignoring the401and resending the request a little > > later > > > > > > > > > solved the problem the majority of the time. > > > > > > > > > > On Nov 22, 2:43 am, Alvin Wang <alvin0...@gmail.com> wrote: > > > > > > > > > > > Hi, > > > > > > > > > > I am currently developing an application using twitter api. > > > > > > > > > > However, i will ramdomly receive401error (invalid > > signature). > > > > > > > > > > Sometime it's working fine but sometime are not. > > > > > > > > > > Can you please help us to resolve this problem? > > > > > > > > > > > BR, > > > > > > > > > > Alvin- 隱藏被引用文字 - > > > > > > > > > > - 顯示被引用文字 - > > > > > > > > > -- > > > > > > > > Twitter developer documentation and resources: > > > > > >http://dev.twitter.com/doc > > > > > > > > API updates via Twitter:http://twitter.com/twitterapi > > > > > > > > Issues/Enhancements Tracker: > > > > > > > >http://code.google.com/p/twitter-api/issues/list > > > > > > > > Change your membership to this group: > > > > > > > >http://groups.google.com/group/twitter-development-talk > > > > > > > -- > > > > > > Twitter developer documentation and resources: > >http://dev.twitter.com/doc > > > > > > API updates via Twitter:http://twitter.com/twitterapi > > > > > > Issues/Enhancements Tracker: > > > > > >http://code.google.com/p/twitter-api/issues/list > > > > > > Change your membership to this group: > > > > > >http://groups.google.com/group/twitter-development-talk > > > -- > > Twitter developer documentation and resources:http://dev.twitter.com/doc > > API updates via Twitter:http://twitter.com/twitterapi > > Issues/Enhancements Tracker: > >http://code.google.com/p/twitter-api/issues/list > > Change your membership to this group: > >http://groups.google.com/group/twitter-development-talk -- Twitter developer documentation and resources: http://dev.twitter.com/doc API updates via Twitter: http://twitter.com/twitterapi Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list Change your membership to this group: http://groups.google.com/group/twitter-development-talk