ZennoLab Assemblies Documentation
Request(HttpMethod,String,Byte[],String,String,String,ResponceType,Int32,String,String,Boolean,Int32,String[],String,Boolean,Boolean,ICookieContainer) Method
Example 
ZennoLab.CommandCenter Namespace > ZennoPoster.HTTP Class > Request Method : Request(HttpMethod,String,Byte[],String,String,String,ResponceType,Int32,String,String,Boolean,Int32,String[],String,Boolean,Boolean,ICookieContainer) Method

Type: ZennoLab.InterfacesLibrary.Enums.Http.HttpMethod

HTTP Method to execute (can take values GET, POST, PUT, HEAD, DELETE, OPTIONS, TRACE, PATCH)

Type: System.String

Target address of request.

Type: System.Byte[]

Specifies the content of POST, PUT or PATCH request.

For other methods use empty array. Null value will cause a compile error, due to type conflict (string and byte[]).

Type: System.String

MIME type for

Value will be set to "Content-Type" header for POST, PUT and PATCH methods.

Default value is "application/x-www-form-urlencoded"

Type: System.String

Proxy string (for example: "socks5://login:pass@8.5.6.7:8080").

Type: System.String

Specifies the encoding to use.

Default value is "UTF-8"

Type: ZennoLab.InterfacesLibrary.Enums.Http.ResponceType

Specifies what parts of response should be returned (can take values: BodyOnly, HeaderOnly, HeaderAndBody,File,FileAndHeaders).

Type: System.Int32

Request timeout in milliseconds.

Default values is 30000 (30 seconds).

Type: System.String

Cookies for request.

Type: System.String

Specifies value for "User-Agent" header.

Type: System.Boolean

true if redirects should be followed.

Default value is true

Type: System.Int32

Maximum count of redirects.

Default values is 5

Type: System.String[]

Array of additional headers and values that will be added to request.

Default value is null

Type: System.String

Download path for file.

Default value is null

Type: System.Boolean

true if use original url; otherwise, false.

Throw exception if error occurs

Type: ZennoLab.InterfacesLibrary.ProjectModel.Collections.ICookieContainer

The object of cookie container. Use a common collection of cookies between browser and http requests.

Executes http request of given method
Syntax

Parameters

method

Type: ZennoLab.InterfacesLibrary.Enums.Http.HttpMethod

HTTP Method to execute (can take values GET, POST, PUT, HEAD, DELETE, OPTIONS, TRACE, PATCH)

url

Type: System.String

Target address of request.

content

Type: System.Byte[]

Specifies the content of POST, PUT or PATCH request.

For other methods use empty array. Null value will cause a compile error, due to type conflict (string and byte[]).

contentPostingType

Type: System.String

MIME type for

Value will be set to "Content-Type" header for POST, PUT and PATCH methods.

Default value is "application/x-www-form-urlencoded"

proxy

Type: System.String

Proxy string (for example: "socks5://login:pass@8.5.6.7:8080").

Encoding

Type: System.String

Specifies the encoding to use.

Default value is "UTF-8"

respType

Type: ZennoLab.InterfacesLibrary.Enums.Http.ResponceType

Specifies what parts of response should be returned (can take values: BodyOnly, HeaderOnly, HeaderAndBody,File,FileAndHeaders).

Timeout

Type: System.Int32

Request timeout in milliseconds.

Default values is 30000 (30 seconds).

Cookies

Type: System.String

Cookies for request.

UserAgent

Type: System.String

Specifies value for "User-Agent" header.

UseRedirect

Type: System.Boolean

true if redirects should be followed.

Default value is true

MaxRedirectCount

Type: System.Int32

Maximum count of redirects.

Default values is 5

AdditionalHeaders

Type: System.String[]

Array of additional headers and values that will be added to request.

Default value is null

DownloadPath

Type: System.String

Download path for file.

Default value is null

UseOriginalUrl

Type: System.Boolean

true if use original url; otherwise, false.

throwExceptionOnError

Throw exception if error occurs

cookieContainer

Type: ZennoLab.InterfacesLibrary.ProjectModel.Collections.ICookieContainer

The object of cookie container. Use a common collection of cookies between browser and http requests.

Return Value

Type: System.String

The result of request.

Example
The following example shows call the Http method.
var response = ZennoPoster.HTTP.Request(ZennoLab.InterfacesLibrary.Enums.Http.HttpMethod.GET, "https://httpbin.org/get?a=b", new byte[0],respType:ZennoLab.InterfacesLibrary.Enums.Http.ResponceType.HeaderAndBody);
var response = ZennoPoster.HTTP.Request(ZennoLab.InterfacesLibrary.Enums.Http.HttpMethod.POST, "https://httpbin.org/post", Encoding.UTF8.GetBytes("Name=Jonathan+Doe&Age=25"), respType:ZennoLab.InterfacesLibrary.Enums.Http.ResponceType.HeaderAndBody);
$response = \ZennoLab\CommandCenter\ZennoPoster\HTTP::Request(\ZennoLab\InterfacesLibrary\Enums\Http\HttpMethod::GET,"https://www.google.ru/", array(),"application/x-www-form-urlencoded","", "UTF-8", ZennoLab\InterfacesLibrary\Enums\Http\ResponceType::HeaderAndBody, 30000,"","",FALSE,5,array(),NULL,FALSE,TRUE);
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

ZennoPoster.HTTP Class
ZennoPoster.HTTP Members
Overload List