I need to send to a website or webserver a POST request, but it must be in its raw form (as seen in fiddler hex view) and then get the response. It is a byte array that I already have (and is always the same) with the "POST ...." with headers, cookies, values, everything set up.
I expect a function like SendRawBytes(url, bytes); that sends only the "bytes" variable.
I've already tried WebClient.UploadData(url, data) but it adds the POST, HOST, Content-Length and Expect to the request, which results in this:
POST http://mail.mymail.com/index.html/?_task=login HTTP/1.1
Host: mail.mymail.com
Content-Length: 1000
Expect: 100-continue
POST http://mail.mymail.com/index.html/?_task=login HTTP/1.1
Host: mail.mymail.com
Connection: keep-alive
Content-Length: 148
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Origin: http://mail.mymail.com
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Referer: http://mail.mymail.com/index.html/
Accept-Encoding: gzip, deflate
Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4
Cookie: __utma=212529476.250438617.1448317607.1448937588.1448974476.6; __utmc=212529476; __utmz=212529476.1448317607.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
_task=login_url=&_user=testuser&_pass=01234
Anything would be of great help!
Thank you in advance.