How to test the twitter API locally?

2019-03-14 16:12发布

I'm trying to write a web application that would use Twitter via OAuth.

  1. I run my local server as 'localhost', so I need the callback URL to be something like http://localhost/something/twitter.do but Twitter doesn't like that: Not a valid URL format

  2. I'm probably going to do a lot of tests, but once I've approved my app with my username, I can't test again can I? Am I supposed to create multiple twitter accounts? Or can you remove an app and do it again?

标签: twitter oauth
7条回答
Animai°情兽
2楼-- · 2019-03-14 16:51

In answer to (1), see this thread, in particular episod's replies: https://dev.twitter.com/discussions/5749

It doesn't matter what callback URL you put in your app's management page on dev.twitter.com (as long as you don't use localhost). You provide the 'real' callback URL as part of your request for an OAuth token.

查看更多
登录 后发表回答