{"title":"HttpClientHandler attribute","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/attributes/devenv-httpclienthandler-attribute/","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/attributes/devenv-httpclienthandler-attribute, 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/attributes/devenv-httpclienthandler-attribute","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":"Specifies that the method is an HttpClientHandler method, which catches and handles HTTP requests in test executions.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":254,"chars":135},{"level":2,"title":"Syntax","slug":"syntax","at":389,"chars":1058},{"level":3,"title":"Arguments","slug":"arguments","at":835,"chars":293},{"level":3,"title":"Return Values","slug":"return-values","at":1128,"chars":319},{"level":2,"title":"Related information","slug":"related-information","at":1447,"chars":115}],"text":"> Version: _Available or changed with runtime version 15.0._\nSpecifies that the method is an HttpClientHandler method, which catches and handles HTTP requests in test executions.\n> NOTE\n> This attribute is supported only in Business Central on-premises.\n## Applies to\n Method\n> NOTE\n> The HttpClientHandler attribute can only be set inside codeunits with the SubType property set to Test.\n## Syntax\n> Version: _Available or changed with runtime version 15.0._\n```al\n[HttpClientHandler]\nprocedure HttpClientHandler(Request: TestHttpRequestMessage; var Response: TestHttpResponseMessage) IssueOriginalRequest: Boolean;\n```\n> IMPORTANT\n> The above signature requires the HttpClientHandler method to be global. See https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-al-methods.md%23local-and-global-scope.\n### Arguments\nRequest\nType: ../methods-auto/testhttprequestmessage/testhttprequestmessage-data-type\nThe HTTP request that need to be handled.\nResponse\nType: ../methods-auto/testhttpresponsemessage/testhttpresponsemessage-data-type\nThe mocked response that need to be populated by the handler.\n### Return Values\nIssueOriginalRequest\nType: ../methods-auto/boolean/boolean-data-type\nIndicates whether to issue the original HTTP request (true) or use the mocked response (false). The default return value of the HttpClientHandler procedure is false, ensuring that external service calls are only made intentionally.\n## Related information\nGetting started with AL<../devenv-get-started>\nDeveloping extensions<../devenv-dev-overview>"}