在对方的网页API测试环境中post请求参数:curl
-X POST "http://192.168.3.10:8088/api/services/Org/UserLogin" -H "accept: application/json" -H "Content-Type: text/json" -d "{ \"UserName\": \"000001\", \"Password\": \"12345\", \"DomainIp\": \"\", \"DeviceId\": \"\", \"WeChatName\": \"\", \"IsWechatType\": \"\", \"ClientType\": \"\", \"UserHostAddress\": \"\", \"ValidateCodeSms\": \"\"}"
测试请求的参数是这样的
{
"UserName": "000001",
"Password": "12345",
"DomainIp": "",
"DeviceId": "",
"WeChatName": "",
"IsWechatType": "",
"ClientType": "",
"UserHostAddress": "",
"ValidateCodeSms": ""
}
返回结构
{
"data": "0064a97bae66bf3647f29aad065d67975a38",
"dataDescription": "",
"result": 0,
"message": ""
}
但是我用HttpClient请求结果没有返回任何结果
Dim url As String = "http://192.168.3.10:8088/api/services/Org/UserLogin"
Dim hc As New HttpClient(url)
Dim jo As New JObject
jo("UserName") = "000001"
jo("Password") = "12345"
jo("DomainIp") = ""
jo("DeviceId") = ""
jo("WeChatName") = ""
jo("IsWechatType") = ""
jo("ClientType") = ""
jo("UserHostAddress") = ""
jo("ValidateCodeSms") = ""
Output.Show(jo.tostring)
hc.FormData.Add("userDto",jo.tostring)
Dim ret As String = hc.GetData
Output.Show(ret)
返回结果是一个空,这个是哪的问题?
[此贴子已经被作者于2021/12/13 16:20:18编辑过]