For the complete documentation index, see llms.txt. This page is also available as Markdown.

SendAndReceiveBytes

HTTP request for sending and receiving content in byte array.

Task version: 1.5.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

Method : Method

The HTTP Method to be used with the request.

Possible values:

  • POST: POST Request.

  • PUT: PUT Request.

  • PATCH: PATCH Request.

  • DELETE: DELETE Request.

  • HEAD: HEAD Request.

  • OPTIONS: OPTIONS Request.

  • CONNECT: CONNECT Request.

Default: POST Example: GET

Url : String

The URL with protocol and path. You can include query parameters directly in the url.

Default: https://example.org/path/to Example: https://example.org/path/to

ContentBytes : Byte[]

The content to send as byte array

Default: - Example: { "Body": "Message" }

Headers : Header[]

List of HTTP headers to be added to the request.

Default: - Example: Name: Header, Value: HeaderValue

Name
Description

Authentication : Authentication

Method of authenticating request

Possible values:

  • None: No authentication.

  • Basic: Basic authentication.

  • WindowsAuthentication: Windows authentication.

  • WindowsIntegratedSecurity: Windows authentication with Integrated Security.

  • OAuth: OAuth authentication.

  • ClientCertificate: Client Certificate authentication.

Default: - Example: OAuth

Username : String

If WindowsAuthentication is selected you should use domain\username

Default: - Example: Username

🗝Password : String

Password for the user

Default: - Example: Password123

🗝Token : String

Bearer token to be used for request. Token will be added as Authorization header.

Default: - Example: Token123

UseProxy : Boolean

Whether to route requests through a proxy server. When set to true, the ProxyUrl must be provided.

Default: False Example: false

ProxyUrl : String

Proxy URL used for the request.

Default: - Example: http://proxy.example.com:8080

ProxyUsername : String

Username for proxy authentication. Leave empty if proxy does not require authentication.

Both username and password must be provided together or left empty.

Default: - Example: Username

🗝ProxyPassword : String

Password for proxy authentication. Leave empty if proxy does not require authentication.

Both username and password must be provided together or left empty.

Default: - Example: Password123

ClientCertificateSource : CertificateSource

Specifies where the Client Certificate should be loaded from.

Possible values:

  • CertificateStore: Source is certificate store.

  • File: Source is a file.

  • String: Source is a string.

Default: CertificateStore Example: File

ClientCertificateFilePath : String

Applicable only when Certificate Source is "File".

Path to the Client Certificate, pfx (pkcs12) files are recommended. For other supported formats, see

https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x509certificate2collection.import?view=netframework-4.7.1

Default: - Example: domain\path

ClientCertificateInBase64 : String

Applicable only when Certificate Source is "String".

Client certificate bytes as a base64 encoded string, pfx (pkcs12) format is recommended. For other supported formats, see

https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x509certificate2collection.import?view=netframework-4.7.1

Default: - Example: domain\path

🗝ClientCertificateKeyPhrase : String

Applicable only when Certificate Source is "File" or "String".

Key phrase (password) to access the certificate data

Default: - Example: string value

CertificateThumbprint : String

Applicable only when Certificate Source is "CertificateStore".

Thumbprint for using client certificate authentication.

Default: - Example: thumbprint

CertificateStoreLocation : CertificateStoreLocation

Applicable only when Certificate Source is "CertificateStore".

Store location for the certificate.

Possible values:

  • CurrentUser: The X.509 certificate store assigned to the current user.

  • LocalMachine: The X.509 certificate store assigned to the local machine.

Default: CurrentUser Example: CurrentUser

LoadEntireChainForCertificate : Boolean

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

Default: True Example: true

ConnectionTimeoutSeconds : Int32

Timeout in seconds to be used for the connection and operation.

Default: 30 Example: 30

FollowRedirects : Boolean

If FollowRedirects is set to false, all responses with an HTTP status code from 300 to 399 is returned to the application.

Default: True Example: true

AllowInvalidCertificate : Boolean

Do not throw an exception on certificate error.

Default: - Example: true

AllowInvalidResponseContentTypeCharSet : Boolean

Some Api's return faulty content-type charset header. This setting overrides the returned charset.

Default: - Example: true

ThrowExceptionOnErrorResponse : Boolean

Throw exception if return code of request is not successfull

Default: - Example: true

AutomaticCookieHandling : Boolean

If set to false, cookies must be handled manually. Defaults to true.

Default: True Example: true

HttpProtocolVersion : HttpVersion

HTTP protocol version to use for requests. HTTP/1.1 is the default and most compatible option.

Possible values:

  • Http11: HTTP/1.1 - default, widely supported.

  • Http20: HTTP/2 - multiplexed, requires server support.

If the server does not support HTTP/2 via ALPN, the request will fail with an exception instead of falling back to HTTP/1.1.

Default: Http11 Example: Http11

SslProtocolVersion : SslVersion

SSL/TLS protocol version to use for secure connections. Default lets the OS decide, which matches previous behavior.

Use Tls12 or Tls12And13 if the server requires a specific version.

Possible values:

  • Default: OS decides the protocol version.

  • Tls12: TLS 1.2 only.

  • Tls13: TLS 1.3 only.

  • Tls12And13: TLS 1.2 and TLS 1.3 - use when server compatibility is uncertain.

Default: Default Example: Default

Task Result

Name
Description

BodyBytes : Byte[]

Body of response Example: {"id": "abcdefghijkl123456789", "success": true, "errors": []}

BodySizeInMegaBytes : Double

Body size of response Example: 10.0

ContentType : MediaTypeHeaderValue

Header type of response Example: 10.0

Headers : Dictionary<String, String>

Headers of response Example: {[ "content-type": "application/json", ... ]}

StatusCode : Int32

Statuscode of response Example: 200

Task Changelog

Changelog for Task Frends.HTTP.SendAndReceiveBytes.

[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 SendAndReceiveBytes 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.0] - 2023-06-01

    Added

    • Initial implementation.

Last updated

Was this helpful?