URL 编码 - oauth_signature
我已成功设置 oauth 身份验证以使用 Sharpbox 访问我的保管箱。 Sharpbox 是一个开源“前端”,负责处理流程的具体细节。使用它我可以返回我帐户中特定文件夹中的文件信息。
我将文件名和生成的 URI 绑定到 VS 2010 Web 应用程序中的 gridview。我有一个超链接,其中文本设置为名称,DataNavigateUrlFields 设置为唯一 URL。如果 url 字符串的 oauth_signature 部分中没有“+”字符,则效果很好。如果有加号,则返回 "{"error": "无效签名。预期签名基字符串:“
感谢您的考虑。
感谢您的帮助,这是我的代码
Public Sub MakeURL()
dbOpen()
Dim myfolder As ICloudDirectoryEntry = dropBoxStorage.GetFolder("/DIR/SUBDIR/")
Filename = Filename & "_POID_" & poid & ".pdf"
pdfurl = dropBoxStorage.GetFileSystemObjectUrl(Filename, myfolder).ToString
dbClose()
pdfurl = pdfurl.Replace("+", "%2B")
Response.Redirect(pdfurl)
End Sub
I have successfully setup the oauth authentication to access my dropbox using sharpbox. Sharpbox is an open source "front end" that handles the nuts and bolts of the process. Using it i can return file info in a particular folder in my account.
I bind the filename and a generated URI to a gridview in a VS 2010 web app. I have a hyperlink with the text set to name and the DataNavigateUrlFields to the unique URL. It works great IF there is no "+" character in the oauth_signature part of the url string. If the plus is there, it returns "{"error": "Invalid signature. Expected signature base string:"
Thanks for your consideration.
Thank you for your help, here is my code
Public Sub MakeURL()
dbOpen()
Dim myfolder As ICloudDirectoryEntry = dropBoxStorage.GetFolder("/DIR/SUBDIR/")
Filename = Filename & "_POID_" & poid & ".pdf"
pdfurl = dropBoxStorage.GetFileSystemObjectUrl(Filename, myfolder).ToString
dbClose()
pdfurl = pdfurl.Replace("+", "%2B")
Response.Redirect(pdfurl)
End Sub
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
OAuth 1 签名使用百分比编码(请参阅 RFC 5849)。规范明确规定空格
不应编码为
+
,而应使用%20
编码。将+
替换为%20
。OAuth 1 Signature uses Percent Encoding (See RFC 5849). The specification clearly states that a space
should not be encoded to a
+
, instead it should be encoded with%20
. Replace your+
with%20
.