> For the complete documentation index, see [llms.txt](https://docs.frends.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.frends.com/tasks/tasks/http/requestbytes.md).

# RequestBytes

Task version: 1.5.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.HTTP/tree/main/Frends.HTTP.RequestBytes>

## Task Parameters

{% tabs %}
{% tab title="Input" %}

| Name                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Method : `Method`    | <p>The HTTP Method to be used with the request.</p><p>Possible values:</p><ul><li><code>GET</code>: The HTTP Method to be used with the request.</li><li><code>POST</code>: The HTTP Method to be used with the request.</li><li><code>PUT</code>: The HTTP Method to be used with the request.</li><li><code>PATCH</code>: The HTTP Method to be used with the request.</li><li><code>DELETE</code>: The HTTP Method to be used with the request.</li><li><code>HEAD</code>: The HTTP Method to be used with the request.</li><li><code>OPTIONS</code>: The HTTP Method to be used with the request.</li><li><code>CONNECT</code>: The HTTP Method to be used with the request.</li></ul><p><br>Default: <code>0</code><br>Example: <code>GET</code></p> |
| Url : `String`       | <p>The URL with protocol and path. You can include query parameters directly in the url.</p><p><br>Default: <code><https://example.org/path/to></code><br>Example: <code><https://example.org/path/to></code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Message : `String`   | <p>The message text to be sent with the request.</p><p><br>Default: <code>-</code><br>Example: <code>{ "Body": "Message" }</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Headers : `Header[]` | <p>List of HTTP headers to be added to the request.</p><p><br>Default: <code>-</code><br>Example: <code>Name: Header, Value: HeaderValue</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| {% endtab %}         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

{% tab title="Options" %}

| Name                                                  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Authentication : `Authentication`                     | <p>Method of authenticating request</p><p>Possible values:</p><ul><li><code>None</code>: Method of authenticating request</li><li><code>Basic</code>: Method of authenticating request</li><li><code>WindowsAuthentication</code>: Method of authenticating request</li><li><code>WindowsIntegratedSecurity</code>: Method of authenticating request</li><li><code>OAuth</code>: Method of authenticating request</li><li><code>ClientCertificate</code>: Method of authenticating request</li></ul><p><br>Default: <code>-</code><br>Example: <code>OAuth</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Username : `String`                                   | <p>If WindowsAuthentication is selected you should use domain\username</p><p><br>Default: <code>-</code><br>Example: <code>Username</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| 🗝Password : `String`                                 | <p>Password for the user</p><p><br>Default: <code>-</code><br>Example: <code>Password123</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| 🗝Token : `String`                                    | <p>Bearer token to be used for request. Token will be added as Authorization header.</p><p><br>Default: <code>-</code><br>Example: <code>Token123</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| UseProxy : `Boolean`                                  | <p>Whether to route requests through a proxy server. When set to true, the ProxyUrl must be provided.</p><p><br>Default: <code>False</code><br>Example: <code>false</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ProxyUrl : `String`                                   | <p>Proxy URL used for the request.</p><p><br>Default: <code>-</code><br>Example: <code><http://proxy.example.com:8080></code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ProxyUsername : `String`                              | <p>Username for proxy authentication. Leave empty if proxy does not require authentication.</p><p>Both username and password must be provided together or left empty.</p><p><br>Default: <code>-</code><br>Example: <code>Username</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| 🗝ProxyPassword : `String`                            | <p>Password for proxy authentication. Leave empty if proxy does not require authentication.</p><p>Both username and password must be provided together or left empty.</p><p><br>Default: <code>-</code><br>Example: <code>Password123</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ClientCertificateSource : `CertificateSource`         | <p>Specifies where the Client Certificate should be loaded from.</p><p>Possible values:</p><ul><li><code>CertificateStore</code>: Specifies where the Client Certificate should be loaded from.</li><li><code>File</code>: Specifies where the Client Certificate should be loaded from.</li><li><code>String</code>: Specifies where the Client Certificate should be loaded from.</li></ul><p><br>Default: <code>0</code><br>Example: <code>File</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ClientCertificateFilePath : `String`                  | <p>Applicable only when Certificate Source is "File".</p><p>Path to the Client Certificate, pfx (pkcs12) files are recommended. For other supported formats, see</p><p><https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x509certificate2collection.import?view=netframework-4.7.1></p><p><br>Default: <code>-</code><br>Example: <code>domain\path</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ClientCertificateInBase64 : `String`                  | <p>Applicable only when Certificate Source is "String".</p><p>Client certificate bytes as a base64 encoded string, pfx (pkcs12) format is recommended. For other supported formats, see</p><p><https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x509certificate2collection.import?view=netframework-4.7.1></p><p><br>Default: <code>-</code><br>Example: <code>domain\path</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| 🗝ClientCertificateKeyPhrase : `String`               | <p>Applicable only when Certificate Source is "File" or "String".</p><p>Key phrase (password) to access the certificate data</p><p><br>Default: <code>-</code><br>Example: <code>string value</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| CertificateThumbprint : `String`                      | <p>Applicable only when Certificate Source is "CertificateStore".</p><p>Thumbprint for using client certificate authentication.</p><p><br>Default: <code>-</code><br>Example: <code>thumbprint</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| CertificateStoreLocation : `CertificateStoreLocation` | <p>Applicable only when Certificate Source is "CertificateStore".</p><p>Store location for the certificate.</p><p>Possible values:</p><ul><li><code>CurrentUser</code>: Applicable only when Certificate Source is "CertificateStore".</li></ul><p>Store location for the certificate.</p><ul><li><code>LocalMachine</code>: Applicable only when Certificate Source is "CertificateStore".</li></ul><p>Store location for the certificate.</p><p><br>Default: <code>0</code><br>Example: <code>CurrentUser</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| LoadEntireChainForCertificate : `Boolean`             | <p>Should the entire certificate chain be loaded from the certificate store and included in the request. Only valid when using Certificate Store as the Certificate Source</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ConnectionTimeoutSeconds : `Int32`                    | <p>Timeout in seconds to be used for the connection and operation.</p><p><br>Default: <code>30</code><br>Example: <code>30</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| FollowRedirects : `Boolean`                           | <p>If FollowRedirects is set to false, all responses with an HTTP status code from 300 to 399 is returned to the application.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| AllowInvalidCertificate : `Boolean`                   | <p>Do not throw an exception on certificate error.</p><p><br>Default: <code>-</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| AllowInvalidResponseContentTypeCharSet : `Boolean`    | <p>Some Api's return faulty content-type charset header. This setting overrides the returned charset.</p><p><br>Default: <code>-</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ThrowExceptionOnErrorResponse : `Boolean`             | <p>Throw exception if return code of request is not successfull</p><p><br>Default: <code>-</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| AutomaticCookieHandling : `Boolean`                   | <p>If set to false, cookies must be handled manually. Defaults to true.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| HttpProtocolVersion : `HttpVersion`                   | <p>HTTP protocol version to use for requests. HTTP/1.1 is the default and most compatible option.</p><p>Possible values:</p><ul><li><code>Http11</code>: HTTP protocol version to use for requests. HTTP/1.1 is the default and most compatible option.</li><li><code>Http20</code>: HTTP protocol version to use for requests. HTTP/1.1 is the default and most compatible option.</li></ul><p><br>Default: <code>0</code><br>Example: <code>Http11</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| SslProtocolVersion : `SslVersion`                     | <p>SSL/TLS protocol version to use for secure connections. Default lets the OS decide, which matches previous behavior.</p><p>Use Tls12 or Tls12And13 if the server requires a specific version.</p><p>Possible values:</p><ul><li><code>Default</code>: SSL/TLS protocol version to use for secure connections. Default lets the OS decide, which matches previous behavior.</li></ul><p>Use Tls12 or Tls12And13 if the server requires a specific version.</p><ul><li><code>Tls12</code>: SSL/TLS protocol version to use for secure connections. Default lets the OS decide, which matches previous behavior.</li></ul><p>Use Tls12 or Tls12And13 if the server requires a specific version.</p><ul><li><code>Tls13</code>: SSL/TLS protocol version to use for secure connections. Default lets the OS decide, which matches previous behavior.</li></ul><p>Use Tls12 or Tls12And13 if the server requires a specific version.</p><ul><li><code>Tls12And13</code>: SSL/TLS protocol version to use for secure connections. Default lets the OS decide, which matches previous behavior.</li></ul><p>Use Tls12 or Tls12And13 if the server requires a specific version.</p><p><br>Default: <code>0</code><br>Example: <code>Default</code></p> |
| {% endtab %}                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| {% endtabs %}                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

## Task Result

| Name                                   | Description                                                                                                      |
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| Body : `Byte[]`                        | <p>Body of response<br>Example: <code>{"id": "abcdefghijkl123456789", "success": true, "errors": \[]}</code></p> |
| BodySizeInMegaBytes : `Double`         | <p>Body size of response<br>Example: <code>10.0</code></p>                                                       |
| ContentType : `MediaTypeHeaderValue`   | <p>Header type of response<br>Example: <code>10.0</code></p>                                                     |
| Headers : `Dictionary<String, String>` | <p>Headers of response<br>Example: <code>{\[ "content-type": "application/json", ... ]}</code></p>               |
| StatusCode : `Int32`                   | <p>Statuscode of response<br>Example: <code>200</code></p>                                                       |

## Task Changelog

Changelog for Task Frends.HTTP.RequestBytes.

### \[1.5.0] - 2026-05-13

#### Added

* Added UseProxy, ProxyUrl, ProxyUsername, ProxyPassword, HttpProtocolVersion, and SslProtocolVersion options with proxy handler and protocol configuration support.

### \[1.4.0] - 2026-03-02

#### Added

* Added CertificateStoreLocation option to allow selection between CurrentUser and LocalMachine certificate stores when using certificate authentication.

### \[1.3.0] - 2025-10-10

#### Changed

* Changed the return type of RequestBytes from Task to Task

  ### \[1.2.0] - 2025-03-25

  #### Changed

  * Update packages: Newtonsoft.Json 12.0.1 -> 13.0.3 System.ComponentModel.Annotations 4.7.0 -> 5.0.0 System.Runtime.Caching 7.0.0 -> 9.0.3 coverlet.collector 3.1.0 -> 6.0.4 Microsoft.NET.Test.Sdk 16.7.0 -> 17.13.0 MSTest.TestAdapter 2.1.2 -> 3.8.3 MSTest.TestFramework 2.1.2 -> 3.8.3 nunit 3.12.0 -> 4.3.2 NUnit3TestAdapter 3.17.0 -> 5.0.0 RichardSzalay.MockHttp 6.0.0 -> 7.0.0 xunit.extensibility.core 2.4.2 -> 2.9.3

  ### \[1.1.0] - 2024-12-30

  #### Changed

  * Descriptions of ClientCertificate suboptions includes clearer information about usage in terms of different types of ClientCertificate.

  ### \[1.0.1] - 2024-01-17

  #### Fixed

  * Fixed issues which CodeQL found in the codebase. Fixed Code Coverage

  ### \[1.0.0] - 2023-01-27

  #### Added

  * Initial implementation of Frends.HTTP.Request.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.frends.com/tasks/tasks/http/requestbytes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
