{"title":"HttpClient.Get(Text, var HttpResponseMessage) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/httpclient/httpclient-get-method/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/httpclient/httpclient-get-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/httpclient/httpclient-get-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Sends a GET request to get the resource identified by the request URL.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"HttpClient.Get(Text, var HttpResponseMessage) Method","slug":"httpclientgettext-var-httpresponsemessage-method","at":0,"chars":4902},{"level":2,"title":"Syntax","slug":"syntax","at":186,"chars":92},{"level":2,"title":"Parameters","slug":"parameters","at":278,"chars":286},{"level":2,"title":"Return Value","slug":"return-value","at":564,"chars":299},{"level":2,"title":"Ways that HttpClient.Get calls can fail","slug":"ways-that-httpclientget-calls-can-fail","at":863,"chars":1134},{"level":2,"title":"Example (HTTP GET)","slug":"example-http-get","at":1997,"chars":1310},{"level":2,"title":"Supported HTTP methods","slug":"supported-http-methods","at":3307,"chars":1379},{"level":2,"title":"Related information","slug":"related-information","at":4686,"chars":216}],"text":"# HttpClient.Get(Text, var HttpResponseMessage) Method\n> Version: _Available or changed with runtime version 1.0._\nSends a GET request to get the resource identified by the request URL.\n## Syntax\n```al\n[Ok := ]  HttpClient.Get(Path: Text, var Response: HttpResponseMessage)\n```\n## Parameters\nHttpClient\nType: httpclient-data-type\nAn instance of the httpclient-data-type data type.\nPath\nType: ../text/text-data-type\nThe path the request is sent to.\nResponse\nType: ../httpresponsemessage/httpresponsemessage-data-type\nThe response received from the remote endpoint.\n## Return Value\n*[Optional] Ok*\nType: ../boolean/boolean-data-type\nAccessing the HttpContent property of HttpResponseMessage in a case when the request fails will result in an error. If you omit this optional return value and the operation does not execute successfully, a runtime error will occur.\n## Ways that HttpClient.Get calls can fail\nThe method HttpClient.Get can fail and return false in the following ways:\n The requestUri isn't an absolute URI.\n The request fails because of an underlying issue, like network connectivity, DNS failure, server certificate validation, or timeout.\n The request times out.\n The response exceeds the allowed limit in MiB. For Business Central online, the limit is 150 MiB. For Business Central on-premises, the server setting NavHttpClientMaxResponseContentSize specifies the limit, which is 150 MiB by default.\n> IMPORTANT\n> Outbound HTTP calls from apps/extensions are blocked by default and must be approved for each extension, otherwise instead of an external call, the system will display the following error message: The request was blocked by the runtime to prevent accidental use of production services.\n> To enable outbound HTTP calls, go to the Extension Management page in Business Central, and choose Configure. Then, on the Extension Settings page, make sure that Allow HttpClient Requests is selected. This setting must be enabled for each app/extension, including library apps.\n## Example (HTTP GET)\nA GET request shouldn't send a body and is used (as the method name indicates) to retrieve (or get) data from a resource. To make an HTTP GET request, given an HttpClient and a URI, use the HttpClient.Get method:\n```al\n    local procedure GetRequest() ResponseText: Text\n    var\n        Client: HttpClient;\n        IsSuccessful: Boolean;\n        Response: HttpResponseMessage;\n        ResponseText: Text;\n    begin\n        IsSuccessful := Client.Get('https://jsonplaceholder.typicode.com/todos/3', Response);\n\n        if not IsSuccessful then begin\n            // handle the error\n        end;\n\n        if not Response.IsSuccessStatusCode() then begin\n            HttpStatusCode := response.HttpStatusCode();\n            // handle the error (depending on the HTTP status code)\n        end;\n\n        Response.Content().ReadAs(ResponseText);\n\n        // Expected output:\n        //   GET https://jsonplaceholder.typicode.com/todos/3 HTTP/1.1\n        //   {\n        //     \"userId\": 1,\n        //     \"id\": 3,\n        //     \"title\": \"fugiat veniam minus\",\n        //     \"completed\": false\n        //   }\n    end;\n```\nThe preceding code:\n Makes a GET request to \"https://jsonplaceholder.typicode.com/todos/3\".\n Ensures that the response is successful.\n Reads the response body as a string.\n## Supported HTTP methods\nThe HttpClient datatype supports the following HTTP methods:\n DELETE\n GET\n PATCH\n POST\n PUT\nThe following table includes links to help you get started with calling external services using different HTTP methods.\nTo|See\nDynamically set the HTTP method from AL, set it on the HttpRequestMessage datatype and use the HttpClient.Send method to call the service.|HttpClient.Send(HttpRequestMessage, var HttpResponseMessage) Method<httpclient-send-method> <br> HttpRequestMessage.Method([Text]) Method<../httprequestmessage/httprequestmessage-method-method>\nDelete data in a service endpoint using the HTTP DELETE method.|HttpClient.Delete(Text, var HttpResponseMessage) Method<httpclient-delete-method>\nRead data from a service endpoint using the HTTP GET method.|HttpClient.Get(Text, var HttpResponseMessage) Method<httpclient-get-method>\nUpdate data in a service endpoint using the HTTP PATCH method (no specific AL method exists for PATCH, so use HttpClient.Send).|HttpClient.Send(Text, HttpContent, var HttpResponseMessage) Method<httpclient-send-method>\nSend data to a service endpoint using the HTTP POST method.|HttpClient.Post(Text, HttpContent, var HttpResponseMessage) Method<httpclient-post-method>\nSend data to a service endpoint using the HTTP PUT method.|HttpClient.Put(Text, HttpContent, var HttpResponseMessage) Method<httpclient-put-method>\n## Related information\nCall external services with the HttpClient data type<../../devenv-httpclient>\nhttpclient-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}