JSONPOST(url, Encoding = "",postData=""){ ;网址,编码, post JSON数据 hObject:=ComObjCreate("WinHttp.WinHttpRequest.5.1") Try { hObject.Open("POST",url,False) hObject.SetRequestHeader("Content-Type", "application/json") hObject.Send(postData) } catch e return -1 if (Encoding && hObject.ResponseBody) { oADO := ComObjCreate("adodb.stream") oADO.Type := 1 oADO.Mode := 3 oADO.Open() oADO.Write(hObject.ResponseBody) oADO.Position := 0 oADO.Type := 2 oADO.Charset := Encoding return oADO.ReadText(), oADO.Close() } return hObject.ResponseText }
60 queries in 1.782 seconds |