Request
Frends Task for executing HTTP requests with String or JSON payload.
Task version: 1.12.0
Required Frends version: 5.7+
Required .NET version: 8.0
Compatible Agents: Crossplatform
Task Parameters
Method : Method
The HTTP Method to be used with the request.
Possible values:
GET: The HTTP Method to be used with the request.POST: The HTTP Method to be used with the request.PUT: The HTTP Method to be used with the request.PATCH: The HTTP Method to be used with the request.DELETE: The HTTP Method to be used with the request.HEAD: The HTTP Method to be used with the request.OPTIONS: The HTTP Method to be used with the request.CONNECT: The HTTP Method to be used with the request.
Default: 0
Example: GET
ResultMethod : ReturnFormat
The HTTP result method to be used with the request.
Possible values:
String: The HTTP result method to be used with the request.JToken: The HTTP result method to be used with the request.
Default: 1
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
Authentication : Authentication
Method of authenticating request
Possible values:
None: Method of authenticating requestBasic: Method of authenticating requestWindowsAuthentication: Method of authenticating requestWindowsIntegratedSecurity: Method of authenticating requestOAuth: Method of authenticating requestClientCertificate: Method of authenticating request
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: Specifies where the Client Certificate should be loaded from.File: Specifies where the Client Certificate should be loaded from.String: Specifies where the Client Certificate should be loaded from.
Default: 0
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: Applicable only when Certificate Source is "CertificateStore".
Store location for the certificate.
LocalMachine: Applicable only when Certificate Source is "CertificateStore".
Store location for the certificate.
Default: 0
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 protocol version to use for requests. HTTP/1.1 is the default and most compatible option.Http20: HTTP protocol version to use for requests. HTTP/1.1 is the default and most compatible option.
Default: 0
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: 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.
Tls12: 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.
Tls13: 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.
Tls12And13: 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.
Default: 0
Example: Default
Task Result
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.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
SslProtocolVersionoption to control the TLS version used for secure connections. Supported values:Default(OS decides, preserves previous behavior),Tls12,Tls13,Tls12And13.Added
HttpProtocolVersionoption 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?

