Home > Software engineering >  VB.net how to send a POST request
VB.net how to send a POST request

Time:09-18

Do you want to be an automatic login tool recently, Intranet, is originally website login,
Fiddle caught results:

The POST HTTP/1.1
http://10.10.10.10/include/action.phpHost: 10.10.10.10
Connection: keep alive -
The Content - Length: 103
Accept: */*
Origin: http://10.10.10.10
X - Requested - With: XMLHttpRequest
The user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.104 Safari 537.36/Core/1.53.4399.400 QQBrowser/9.7.12828.400
The content-type: application/x - WWW - form - urlencoded; Charset=utf-8
Referer: http://10.10.10.10/srun_portal_pc.php? Ac_id=1 & amp;
The Accept - Encoding: gzip, deflate
The Accept - Language: useful - CN, useful; Q=0.8
Cookie: login=252 f64 bQ0aSqT4hjWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5PA9Q0L7AM % % 252 bw5kcgolf1uiykaaaaaaaaaaacsauciadve9%252 bjfuxenpvyn0wm9myzbtnwxwdkqxkfxrtrwfr3i

Action=login& The username=000000 & amp; Password={B} AAAAAAAA& Ac_id=1 & amp; User_ip=& amp; Nas_ip=& amp; User_mac=& amp; Save_me=1 & amp; Ajax=1



How to use VB.net to send the same data?

CodePudding user response:

 dim the WBC as new system.net.webclient 
The WBC. Headers. The add (" the content-type ", "application/x - WWW - form - urlencoded")
Dim the result as string=
The WBC. Upload (" http://10.10.10.10/include/action.php ", "action=login& The username=000000 & amp; Password={B} AAAAAAAA& Ac_id=1 & amp; User_ip=& amp; Nas_ip=& amp; User_mac=& amp; Save_me=1 & amp; Ajax=1 ")

CodePudding user response:

reference 1st floor Runnerchin response:
 dim the WBC as new system.net.webclient 
The WBC. Headers. The add (" the content-type ", "application/x - WWW - form - urlencoded")
Dim the result as string=
The WBC. Upload (" http://10.10.10.10/include/action.php ", "action=login& The username=000000 & amp; Password={B} AAAAAAAA& Ac_id=1 & amp; User_ip=& amp; Nas_ip=& amp; User_mac=& amp; Save_me=1 & amp; Ajax=1 ")

This does not include the cookie information

CodePudding user response:

WebClient Post data to support cookies

CodePudding user response:

Baidu search relevant keywords,
  • Related