{"title":"HttpClient.Delete(Text, var HttpResponseMessage) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/httpclient/httpclient-delete-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-delete-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-delete-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 DELETE request to delete the resource identified by the request URL.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"HttpClient.Delete(Text, var HttpResponseMessage) Method","slug":"httpclientdeletetext-var-httpresponsemessage-method","at":0,"chars":4892},{"level":2,"title":"Syntax","slug":"syntax","at":195,"chars":95},{"level":2,"title":"Parameters","slug":"parameters","at":290,"chars":286},{"level":2,"title":"Return Value","slug":"return-value","at":576,"chars":299},{"level":2,"title":"Ways that HttpClient.Delete calls can fail","slug":"ways-that-httpclientdelete-calls-can-fail","at":875,"chars":1140},{"level":2,"title":"Example (HTTP DELETE)","slug":"example-http-delete","at":2015,"chars":1282},{"level":2,"title":"Supported HTTP methods","slug":"supported-http-methods","at":3297,"chars":1379},{"level":2,"title":"Related information","slug":"related-information","at":4676,"chars":216}],"text":"# HttpClient.Delete(Text, var HttpResponseMessage) Method\n> Version: _Available or changed with runtime version 1.0._\nSends a DELETE request to delete the resource identified by the request URL.\n## Syntax\n```al\n[Ok := ]  HttpClient.Delete(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.Delete calls can fail\nThe method HttpClient.Delete 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 DELETE)\nA DELETE request deletes an existing resource. A DELETE request is idempotent but not safe, meaning multiple DELETE requests to the same resources yield the same result, but the request affects the state of the resource. To make an HTTP DELETE request, given an HttpClient and a URI, use the HttpClient.Delete method:\n```al\n    local procedure DeleteRequest() ResponseText: Text\n    var\n        Client: HttpClient;\n        IsSuccessful: Boolean;\n        Response: HttpResponseMessage;\n        ResponseText: Text;\n    begin\n        IsSuccessful := Client.Delete('https://jsonplaceholder.typicode.com/todos/1', 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        //   DELETE https://jsonplaceholder.typicode.com/todos/1 HTTP/1.1\n        //   {}\n    end;\n```\nThe preceding code:\n Makes a DELETE request to \"https://jsonplaceholder.typicode.com/todos/1\".\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>"}