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

Request

Frends Task for executing HTTP requests with String or JSON payload.

Task version: 1.14.0

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

Method : Method

The HTTP Method to be used with the request.

Possible values:

  • GET: GET Request.

  • POST: POST Request.

  • PUT: PUT Request.

  • PATCH: PATCH Request.

  • DELETE: DELETE Request.

  • HEAD: HEAD Request.

  • OPTIONS: OPTIONS Request.

  • CONNECT: CONNECT Request.

Default: GET Example: GET

ResultMethod : ReturnFormat

The HTTP result method to be used with the request.

Possible values:

  • String: HTTP result as a string.

  • JToken: REST result as an JToken.

Default: JToken Example: REST

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

Message : String

The message text to be sent with the request.

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

CacheHttpClient : Boolean

Define to use a caching mechanism for HttpClient.

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

ThrowErrorOnFailure : Boolean

Whether to throw an error on failure.

Default: True Example: true

ErrorMessageOnFailure : String

Overrides the error message on failure.

Default: - Example: HTTP request failed: connection refused

Task Result

Name
Description

Success : Boolean

Indicates whether the task completed successfully. Example: true

Error : Error

Error details. Null when Success is true. Example: null

Error.Message : String

Error message. Example: An error occurred while processing the request.

Error.AdditionalInfo : Exception

Additional error information, such as the original exception. Example: null

Body : Object

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

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.Request.

[1.14.0] - 2026-10-20

Changed

  • HTTP client cache key is now derived with PBKDF2-SHA256.

[1.13.0] - 2026-08-17

Added

  • Added ThrowErrorOnFailure and ErrorMessageOnFailure options to control error handling: when ThrowErrorOnFailure is set to false, the task returns a Result with Success = false and an Error object instead of throwing an exception.

  • The Result type now includes Success and Error properties to indicate task outcome.

[1.12.0] - 2026-06-12

Fixed

  • Fixed an issue related to concurrency problem with static fields.

[1.11.0] - 2026-05-07

Added

  • Added use proxy, proxy URL, username, and password options for configuring HTTP requests through a proxy, and included those settings in the HttpClient cache key.

[1.10.0] - 2026-05-05

Added

  • Added SslProtocolVersion option to control the TLS version used for secure connections. Supported values: Default (OS decides, preserves previous behavior), Tls12, Tls13, Tls12And13.

  • Added HttpProtocolVersion option to control the HTTP protocol version used for requests. Supported values: Http11 (default, preserves previous behavior), Http20 (requires server-side HTTP/2 support via ALPN; no fallback to HTTP/1.1).

[1.9.0] - 2026-04-15

Fixed

  • Fixed an issue where selecting JToken as the return format would throw an exception if the server returned a non-JSON response; the response body is now returned as a raw string instead, preserving the status code for flow control.

[1.8.0] - 2026-03-07

Fixed

  • Improve the handling of disposable objects to avoid problems with timeouts related to HttpClient.

Added

  • Added an option "CacheHttpClient" to disable caching httpClient. (there were cached by default)

[1.7.0] - 2026-03-03

Added

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

[1.6.0] - 2026-01-27

Fixed

  • GET requests ignore message body content

[1.5.0] - 2025-10-03

Changed

  • Changed default return format from String to JToken

[1.4.0] - 2025-03-25

Changed

  • Update packages: Newtonsoft.Json 12.0.1 -> 13.0.3 System.DirectoryServices 7.0.0 -> 9.0.3 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.3.0] - 2024-12-30

Changed

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

[1.2.0] - 2024-08-19

Changed

  • Removed handling where only PATCH, PUT, POST and DELETE requests were allowed to have the Content-Type header and content, due to HttpClient failing if e.g., a GET request had content. HttpClient has since been updated to tolerate such requests.

[1.1.2] - 2024-01-16

Fixed

  • Fixed misleading documentation.

[1.1.1] - 2023-06-09

Fixed

  • Fixed issue with terminating the Task by adding cancellationToken to the method ReadAsStringAsync when JToken as ReturnFormat.

[1.1.0] - 2023-05-08

Changed

  • [Breaking] Changed ResultMethod to ReturnFormat which describes the parameter better.

  • Fixed documentation link in the main method.

[1.0.0] - 2023-01-24

Added

  • Initial implementation of Frends.HTTP.Request.

Last updated

Was this helpful?