Skip to content

HttpRequestHeaders

class cAlgo.API

DesktopCLICloud

The class that represents an HTTP request headers collection.

Definition

public sealed class HttpRequestHeaders

Namespace: cAlgo.API · Group: HTTP

Examples

var request = new HttpRequest(new Uri("https://api.example.com/account"));
request.Headers.Add("Authorization", "Bearer my-token");
request.Headers.Add("Accept", "application/json");
foreach (var header in request.Headers)
    Print("{0}: {1}", header.Key, header.Value);
from System import Uri

request = HttpRequest(Uri("https://api.example.com/account"))
request.Headers.Add("Authorization", "Bearer my-token")
request.Headers.Add("Accept", "application/json")
for header in request.Headers:
    api.Print(f"{header.Key}: {header.Value}")

Methods

Name Description
AddDesktopCLICloudvoid Adds a new header.
GetEnumeratorDesktopCLICloudIEnumerator<KeyValuePair<string, string>> Returns an enumerator that iterates through HttpRequestHeaders.
GetValueDesktopCLICloudstring Returns an existing header value.
RemoveDesktopCLICloudbool Removes an existing header.
UpdateDesktopCLICloudvoid Updates an existing header.

See also