如何在本地测试 twitter API? [英] How to test the twitter API locally?

查看:54
本文介绍了如何在本地测试 twitter API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个通过 OAuth 使用 Twitter 的网络应用程序.

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

  1. 我将本地服务器作为localhost"运行,因此我需要回调 URL 类似于 http://localhost/something/twitter.do 但 Twitter 不喜欢这样:不是有效的 URL 格式

  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

我可能会进行很多测试,但是一旦我使用我的用户名批准了我的应用程序,我就不能再进行测试了,对吗?我应该创建多个推特账户吗?或者你可以删除一个应用程序然后再做一次吗?

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?

推荐答案

  1. 您可以使用 127.0.0.1 而不是 localhost.

您可以从同一个 Twitter 帐户授权多次,而无需撤销它.但是,authenticate 操作只会提示允许/拒绝一次,并且所有后续的 authenticate 请求都会通过,直到您撤销权限.

You can authorize your app as many times as you like from the same twitter account without the necessity to revoke it. However, the authenticate action will only prompt for Allow/Deny once and all subsequent authenticate requests will just pass through until you revoke the privilege.

这篇关于如何在本地测试 twitter API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆