[英]Getting error “invalid uri” when using http://localhost
I'm working with my first api here and I'm trying to get through the Oauth authorization so i can start working with the api. 我正在使用我的第一个api,并且正在尝试通过Oauth授权,以便可以开始使用api。 When trying to get the short life access key with the following code surveymonkey is telling me I have an invalid uri.
当尝试使用以下代码获取短寿命访问密钥时,Surveymonkey告诉我我有一个无效的uri。 The api key and username are replaced with dummies
api密钥和用户名已替换为虚拟变量
string url = "https://api.surveymonkey.net/oauth/authorize";
string api_key = "api_key=sdwertyujgfv3f24qqa4kfyd";
string client_id = "client_id=XXX";
string redirect_uri="redirect_uri=http://localhost";
url = url + "?" + redirect_uri +"&" + client_id + "&" + api_key;
System.Diagnostics.Process.Start(url);
What is the uri and how do i use is in this situation. 在这种情况下,什么是uri?如何使用?
You can not bitly a localhost
link. 您不能咬
localhost
链接。 You could try with 127.0.0.1
instead just to get it to work. 您可以尝试使用
127.0.0.1
来使其正常工作。 But ultimately once the app is deployed it's hostname will not be localhost so it will work if that was the only obstacle. 但是最终,一旦部署了该应用程序,它的主机名就不会是localhost,因此,如果这是唯一的障碍,它将可以正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.