【发布时间】:2014-05-24 05:20:59
【问题描述】:
我正在尝试连接到 VB.NET 中的 Shopify API 并下载一些 json 订单信息,但每次尝试我都会收到“401 未授权访问”错误。我用来实现这一点的代码如下:
'Develop API string to get orders
Dim url As String
url = "https://" & apikey & ":" & apipassword & "@" & domain & "/admin/orders.json"
'Create new web service connection
Dim ws As New WebClient()
'Get json data from remote Shopify server
Dim json_data As String
Try
json_data = ws.DownloadString(url)
Catch ex As Exception
MsgBox("Connection to the remote server failed! Please check your internet connection or contact the developer.", vbOKOnly, "Connection Failed")
Exit Sub
End Try
我了解 Shopify 使用了另一个级别的授权 (OAuth),但我不知道如何实施。如果有人能够提供帮助,将不胜感激。
【问题讨论】:
-
我无法找到类似的 shopify URL 调用示例。你有没有考虑过使用他们的.NET API
标签: json vb.net api oauth shopify