简体   繁体   English

使用http:// localhost时出现错误“无效的uri”

[英]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.

相关问题 使用IP地址而不是localhost时获取HTTP错误400 - Getting HTTP Error 400 when using IP address instead of localhost 使用httpclient消费时出现无效URI错误 - Invalid URI Error when using httpclient to consume REST API Web服务错误“提供的URI方案'http'无效; 预计'https'。“ - Web Service Error “The provided URI scheme 'http' is invalid; expected 'https'.” 捕获提供的URI方案“ http”无效; 预期的“ https”错误 - Catch The provided URI scheme 'http' is invalid; expected 'https' error 无效的URI:在指定带有端口号的URL时在C#中指定的无效端口,如http:// localhost:8080 / jasperserver / rest - Invalid URI: Invalid port specified in C# on specifying URL with port number in it like http://localhost:8080/jasperserver/rest 在 WebAPI 和 AngularJS 中出现错误:“未找到与请求 URI 匹配的 HTTP 资源” - Getting the error: “No HTTP resource was found that matches the request URI” in WebAPI and AngularJS 我收到错误“没有找到与请求 URI 匹配的 HTTP 资源” - I am getting error “No HTTP resource was found that matches the request URI” 使用 += 运算符时出现“无效的表达式项”错误 - Getting “invalid expression term” ERROR when using the += operator 在带有 OAuth 的 http://localhost 上使用 Chrome 默认 SameSite 设置时,.NET Core 中的关联失败错误 - Correlation failed error in .NET Core on Chrome default SameSite settings when using on http://localhost with OAuth 使用 Uri 下载 blob 时出现错误“404 指定的 blob 不存在” - Getting error "404 The specified blob does not exist" when downlading blob using Uri
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM