Local $url = 'https://dwz.cn/admin/v2/create'Local $dat = 'https://www.baidu.com'
Local $tt = _PostDat($url, $dat)
MsgBox(0, '', $tt)
Func _PostDat($url, $dat)
Local $NetData
$oHttp = ObjCreate("WinHttp.WinHttpRequest.5.1")
$oHttp.Option(4) = 13056 ; 忽略错误标志
$oHttp.SetTimeOuts(1000, 1000, 1000, 3000) ; 设置超时时间
$oHttp.Open("POST", $url, True)
$oHttp.setRequestHeader('Content-Type', 'application/json')
$oHttp.setRequestHeader('Token', 'aead77a2f42bfa0872e6e99df0c2f31e')
$oHttp.setRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36")
$oHttp.Send('{"url":"' & $dat & '"}')
$oHttp.waitforresponse
$NetData = BinaryToString($oHttp.Responsebody, 4)
Return $NetData
EndFunc ;==>_PostDat
|