Private Sub SurroundingSub()
Dim client = New RestClient("/tool/open_api/api/goods/cat-detail?id=<id>")
client.Timeout = -1
Dim request = New RestRequest(Method.[GET])
request.AddHeader("X-Signature", "{{signature}}")
request.AddHeader("X-Timestamps", "{{timestamps}}")
request.AddHeader("X-Nonce", "{{nonce}}")
request.AddHeader("X-Apikey", "{{api_key}}")
client.UserAgent = "Apifox/1.0.0 (https://apifox.com)"
Dim response As IRestResponse = client.Execute(request)
Console.WriteLine(response.Content)
End Sub
[此贴子已经被作者于2024/1/3 19:06:38编辑过]
补齐命名空间,放到全局代码
public Sub SurroundingSub()
Dim client = New xxx命名空间.RestClient("/tool/open_api/api/goods/cat-detail?id=<id>")
client.Timeout = -1
Dim request = New xxx命名空间.RestRequest(xxx命名空间.Method.[GET])
request.AddHeader("X-Signature", "{{signature}}")
request.AddHeader("X-Timestamps", "{{timestamps}}")
request.AddHeader("X-Nonce", "{{nonce}}")
request.AddHeader("X-Apikey", "{{api_key}}")
client.UserAgent = "Apifox/1.0.0 (https://apifox.com)"
Dim response As xxx命名空间.IRestResponse = client.Execute(request)
output.show(response.Content)
End Sub
按钮事件直接调用即可
SurroundingSub()
如果不懂什么是命名空间,网上搜搜。
至于1楼使用的什么命名空间,到抄代码的地方找。代码从哪来的去问那里