Socket set header
(→Example) |
|||
Line 35: | Line 35: | ||
The example below sets the header User Agent to <pre>Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36</pre> | The example below sets the header User Agent to <pre>Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36</pre> | ||
+ | socket navigate to the a website that checks headers, and loads the socket html in the browser. | ||
<pre> | <pre> | ||
plugin command("SocketCommands.dll", "socket container") { | plugin command("SocketCommands.dll", "socket container") { | ||
plugin command("SocketCommands.dll", "socket set header", "User-Agent", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36") | plugin command("SocketCommands.dll", "socket set header", "User-Agent", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36") | ||
− | plugin command("SocketCommands.dll", "socket navigate", "GET", " | + | plugin command("SocketCommands.dll", "socket navigate", "GET", "https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending") |
+ | load html($plugin function("SocketCommands.dll", "$socket page html")) | ||
} | } | ||
− | |||
</pre> | </pre> |
Latest revision as of 16:18, 8 November 2016
This command is a Socket Command. The socket set header command sets a header for the next socket navigate command.
This command words within the socket container with the socket navigate command.
The set header command comes with the following headers:
Accept Specifies which Internet media types are acceptable for the response and to assign preferences to them.
Accept-Charset Specifies which character encodings (confusingly called "charsets") are acceptable for the response and to assign preferences to them.
Accept-Encoding Specifies which data format tranformations, confusingly called content (en)codings, such as compression mechanisms, are acceptable for the response and to assign preferences to them.
Accept-Language Specifies which natural languages are acceptable for the response and to assign preferences to them.
Authorization Consists of credentials containing the authentication information of the client for the realm of the resource being requested
Referer Used by a client to specify, for the server's benefit, the address (URI) of the resource from which the Request-URI was obtained.
User-Agent Contains information about the user agent (client) originating the request
For more information and examples of each type of header, please see Header Field Definitions
[edit] Example
The socket set header command is placed before the socket navigate command.
The example below sets the header User Agent toMozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36
socket navigate to the a website that checks headers, and loads the socket html in the browser.
plugin command("SocketCommands.dll", "socket container") { plugin command("SocketCommands.dll", "socket set header", "User-Agent", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36") plugin command("SocketCommands.dll", "socket navigate", "GET", "https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending") load html($plugin function("SocketCommands.dll", "$socket page html")) }