Webbrower Custom HTTP Headers

Source: Internet
Author: User
Tags http post

This need should be more normal, online also, but the solution is more complex, not necessarily applicable (high version ie,64 bit, etc.)

In fact, Ms Early for us to achieve, maybe we usually do not pay attention to

WebBrowser. Navigate method (Uri, String, Byte[], String)

Public void Navigate (
Uri URL,
string targetframename,
byte [] PostData,
string additionalheaders
)

Parameters
url
type: System Uri
a uri , which represents the URL of the document to be loaded.
Targetframename
Type: System . String
The name of the frame in which the document is to be loaded.
PostData
Type: System . Byte []
HTTP POST data, such as form data.
Additionalheaders
Type: System . String
The HTTP header to add to the default header.



How to use it:

This.webBrowser1.Navigate ("www.baidu.com", NULL, NULL, @ "content-type:application/x-www-form-urlencoded" + System.environment.newline+ "referer:http://foo.com\r\n");


With fiddler tracking, you can see the effect immediately, and the custom header takes effect.


??

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Webbrower Custom HTTP Headers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.