---
id: object/codeunit/2350
type: object
title: Codeunit 2350 "Rest Client"
summary: Codeunit 2350 "Rest Client" in System Application (System.RestClient). 38 public procedures. Present since at least BC23, still in BC30, changed in BC26.
tier: official
language: en
tags:
  - codeunit
  - system application
versions:
  introduced: null
  last_changed: "26"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 1732139366debd56dc109813c381f8ddb562382862c5af41eedb87c1b1b4f60a
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Rest%20Client/src/RestClient.Codeunit.al
    title: src/System Application/App/Rest Client/src/RestClient.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 2350
name: Rest Client
namespace: System.RestClient
app: System Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "26"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 38
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 1
  called_by: 5
  implements: 0
---

# Codeunit 2350 "Rest Client"

> Codeunit 2350 "Rest Client" in System Application (System.RestClient). 38 public procedures. Present since at least BC23, still in BC30, changed in BC26.

System Application · System.RestClient · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Rest%20Client/src/RestClient.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Public |

## Procedures

- `Create(): Codeunit "Rest Client"`: Initializes a new instance of the Rest Client class.
- `Create(HttpClientHandler: Interface "Http Client Handler"): Codeunit "Rest Client"`: Initializes a new instance of the Rest Client class.
- `Create(HttpAuthentication: Interface "Http Authentication"): Codeunit "Rest Client"`: Initializes a new instance of the Rest Client class.
- `Create(HttpClientHandler: Interface "Http Client Handler"; HttpAuthentication: Interface "Http Authentication"): Codeunit "Rest Client"`: Initializes a new instance of the Rest Client class.
- `Initialize()`: Initializes the Rest Client with the default Http Client Handler and anonymous Http authentication.
- `Initialize(HttpClientHandler: Interface "Http Client Handler")`: Initializes the Reest Client with the given Http Client Handler
- `Initialize(HttpAuthentication: Interface "Http Authentication")`: Initializes the Rest Client with the given Http Authentication.
- `Initialize(HttpClientHandler: Interface "Http Client Handler"; HttpAuthentication: Interface "Http Authentication")`: Initializes the Rest Client with the given Http Client Handler and Http Authentication.
- `SetDefaultRequestHeader(Name: Text; Value: Text)`: Sets a new value for an existing default header of the Http Client object, or addds the header if it does not already exist.
- `SetDefaultRequestHeader(Name: Text; Value: SecretText)`: Sets a new value for an existing default header of the Http Client object, or addds the header if it does not already exist.
- `SetBaseAddress(Url: Text)`: Sets the base address of the Rest Client.
- `GetBaseAddress(): Text`: Gets the base address of the Rest Client.
- `SetTimeOut(Timeout: Duration)`: Sets the timeout of the Rest Client.
- `GetTimeOut(): Duration`: Gets the timeout of the Rest Client.
- `AddCertificate(Certificate: Text)`: Adds a certificate to the Rest Client.
- `AddCertificate(Certificate: Text; Password: SecretText)`: Adds a certificate to the Rest Client.
- `SetUseServerCertificateValidation(Value: Boolean)`: Sets the use of server certificate validation.
- `SetUserAgentHeader(Value: Text)`: Sets the user agent header of the Rest Client.
- `SetAuthorizationHeader(Value: SecretText)`: Sets the authorization header of the Rest Client.
- `SetUseResponseCookies(Value: Boolean)`: Sets the use of response cookies in subsequent requests.
- `Get(RequestUri: Text): Codeunit "Http Response Message"`: Sends a GET request to the specified Uri and returns the response message.
- `Post(RequestUri: Text; Content: Codeunit "Http Content"): Codeunit "Http Response Message"`: Sends a POST request to the specified Uri and returns the response message.
- `Patch(RequestUri: Text; Content: Codeunit "Http Content"): Codeunit "Http Response Message"`: Sends a PATCH request to the specified Uri and returns the response message.
- `Put(RequestUri: Text; Content: Codeunit "Http Content"): Codeunit "Http Response Message"`: Sends a PUT request to the specified Uri and returns the response message.
- `Delete(RequestUri: Text): Codeunit "Http Response Message"`: Sends a DELETE request to the specified Uri and returns the response message.
- `GetAsJson(RequestUri: Text): JsonToken`: Sends a GET request to the specified Uri and returns the response content as JsonToken.
- `PostAsJson(RequestUri: Text; Content: JsonObject): JsonToken`: Sends a POST request to the specified Uri and returns the response content as JsonToken.
- `PostAsJson(RequestUri: Text; Content: JsonArray): JsonToken`: Sends a POST request to the specified Uri and returns the response content as JsonToken.
- `PostAsJson(RequestUri: Text; Content: JsonToken): JsonToken`: Sends a POST request to the specified Uri and returns the response content as JsonToken.
- `PatchAsJson(RequestUri: Text; Content: JsonObject): JsonToken`: Sends a PATCH request to the specified Uri and returns the response content as JsonToken.
- `PatchAsJson(RequestUri: Text; Content: JsonArray): JsonToken`: Sends a PATCH request to the specified Uri and returns the response content as JsonToken.
- `PatchAsJson(RequestUri: Text; Content: JsonToken): JsonToken`: Sends a PATCH request to the specified Uri and returns the response content as JsonToken.
- `PutAsJson(RequestUri: Text; Content: JsonObject): JsonToken`: Sends a PUT request to the specified Uri and returns the response content as JsonToken.
- `PutAsJson(RequestUri: Text; Content: JsonArray): JsonToken`: Sends a PUT request to the specified Uri and returns the response content as JsonToken.
- `PutAsJson(RequestUri: Text; Content: JsonToken): JsonToken`: Sends a PUT request to the specified Uri and returns the response content as JsonToken.
- `Send(Method: Enum "Http Method"; RequestUri: Text): Codeunit "Http Response Message"`: Sends a request with the specific Http method and an empty content to the specified Uri and returns the response message.
- `Send(Method: Enum "Http Method"; RequestUri: Text; Content: Codeunit "Http Content"): Codeunit "Http Response Message"`: Sends a request with the specific Http method and the given content to the specified Uri and returns the response message.
- `Send(var HttpRequestMessage: Codeunit "Http Request Message"): Codeunit "Http Response Message"`: Sends the given request message and returns the response message.

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 2351 "Rest Client Impl."](../codeunit/2351.md) (14 calls: `AddCertificate → AddCertificate`, `Create → Create`, `GetAsJson → GetAsJson`, …)

## Called by

- [Codeunit 9354 "Graph Request Helper"](../codeunit/9354.md) (5 calls: `Delete → Delete`, `Get → Get`, `GetByFullUrl → Get`, …)
- [Codeunit 2515 "AppSource Product Manager"](../codeunit/2515.md) (3 calls: `DownloadAndAddNextPageProducts → SetDefaultRequestHeader`, `GetProductsAndPopulateRecord → Initialize`, `SetCommonHeaders → SetDefaultRequestHeader`)
- [Codeunit 9123 "SharePoint Graph Req. Helper"](../codeunit/9123.md) (2 calls: `UploadChunk → Initialize`, `UploadChunk → Put`)
- [Codeunit 2518 "AppSrc Product Deps. Provider"](../codeunit/2518.md) (1 call: `GetAsJSon → GetAsJson`)
- [Codeunit 9351 "Graph Client Impl."](../codeunit/9351.md) (1 call: `Initialize → Initialize`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC26

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Rest Client")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
