public static byte[] RequestBytes( HttpMethod method, string url, string content, string contentPostingType, string proxy, string Encoding, ResponceType respType, int Timeout, string Cookies, string UserAgent, bool UseRedirect, int MaxRedirectCount, string[] AdditionalHeaders, string DownloadPath, bool UseOriginalUrl, bool throwExceptionOnError, ICookieContainer cookieContainer )
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.String
Specifies the content of POST, PUT or PATCH request.
For other methods empty string can be used.
- 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.