0
我正在尝试执行POST到Web服务。我正在使用WebClient类并调用uploadstring方法。这工作正常,直到我调用的Web服务需要一些数据,特别是一个JSON数组。我试图找出数据需要采用什么格式,以便Web服务能够正确接受和使用它。例如:POST使用uploadstring方法调用Web服务并传递json数组
WebClient myWebClient = new WebClient();
string resp = myWebClient.UploadString("www.myUrl.com", "POST", "someDataToSend");
任何帮助在这里将不胜感激!
Web服务(vb.net)被称为花费keyvaluepair:
<OperationContract(), WebInvoke(BodyStyle:=WebMessageBodyStyle.WrappedRequest, Method:="POST", RequestFormat:=WebMessageFormat.Json, ResponseFormat:=WebMessageFormat.Json)> _
Public Function DoSomething(ByVal myKeyValuePair() As KeyValuePair(Of String, String)) As String