http_request_post plugin
services: data-explorer
http_request_post plugin
The http_request_post plugin sends an HTTP POST request and converts the response into a table.
Prerequisites
- Run
.enable plugin http_request_postto enable the plugin - Set the URI to access as an allowed destination for
webapiin the Callout policy
Syntax
evaluate http_request_post ( Uri [, RequestHeaders [, Options [, Content]]] )
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| Uri | string | ✔️ | The destination URI for the HTTPS request. |
| RequestHeaders | dynamic | A property bag containing HTTP headers to send with the request. | |
| Options | dynamic | A property bag containing additional properties of the request. | |
| Content | string | The body content to send with the request. The content is encoded in UTF-8 and the media type for the Content-Type attribute is application/json. |
Authentication and authorization
To authenticate, use the HTTP standard Authorization header or any custom header supported by the web service.
Returns
The plugin returns a table that has a single record with the following dynamic columns:
- ResponseHeaders: A property bag with the response header.
- ResponseBody: The response body parsed as a value of type
dynamic.
If the HTTP response indicates (via the Content-Type response header) that the media type is application/json,
the response body is automatically parsed as-if it’s a JSON object. Otherwise, it’s returned as-is.
Headers
The RequestHeaders argument can be used to add custom headers to the outgoing HTTP request. In addition to the standard HTTP request headers and the user-provided custom headers, the plugin also adds the following custom headers:
| Name | Description |
|---|---|
x-ms-client-request-id | A correlation ID that identifies the request. Multiple invocations of the plugin in the same query will all have the same ID. |
x-ms-readonly | A flag indicating that the processor of this request shouldn’t make any persistent changes. |
Example
The following example is for a hypothetical HTTPS web service that accepts additional request headers and must be authenticated to using Microsoft Entra ID:
let uri='https://example.com/node/js/on/eniac';
let headers=dynamic({'x-ms-correlation-vector':'abc.0.1.0', 'authorization':'bearer ...Azure-AD-bearer-token-for-target-endpoint...'});
evaluate http_request_post(uri, headers)
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.