|
网址为内网,需上VPN后才可以访问,但是抓包抓取到的地址直接输入是无法访问的,如下:
抓包数据如下:
代码如下:
boundary = GetBoundary()
SendData = GetUpLoadSendData(boundary, FileFullName, _
ContentDispositionName, FileFullName)
Set obj = CreateObject("MSXML2.XMLHTTP")
With obj
.Open "POST", LinkAddress, False
'.setoption(6) = False
'.setOption(2) = 13056 '只会忽略服务器证书错误。
.setRequestHeader "Referer", "https://pmis.gmcc.net/a/ck/pmisSurveyReport/listAdd?projectCode=B18302110W02A28&projectName=" & encodeURI("XXXXXXXXXXXXXXXXXXXX") & "&prjId=f155534598104c1399bfd4299727dd0e"
.setRequestHeader "Cookie", "funcName=asyncPage;pmis.session.id=2c0f31660c124fa5aafe8c486c736425"
.setRequestHeader "Content-Type", "multipart/form-data; boundary=" & boundary
.setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko"
.setRequestHeader "Connection", "Keep-Alive"
.setRequestHeader "Accept-Encoding", "gzip, deflate"
.Send SendData
Debug.Print .responseText '
End With
子函数就是
头+身体部分+文件数据+页脚部分
能否有大神帮忙指点一二,万分感谢!
|
|