Description
The function HTTPPost sends an HTTP POST request to the specified URL. The request type is defined by the type parameter, and the payload is specified by the data parameter.
Syntax
HTTPPost(url, type, data)
Arguments
| Argument | Description |
|---|---|
url |
The target URL to which the POST request is sent. |
type |
The content type of the request. Typically, 'application/json' for JSON data. |
data |
The payload of the request. It should be provided in the appropriate format (e.g., JSON). |
Return Type
The function does not return a direct value. It sends the request to the server and executes the specified action.
Examples
| Description | Formula |
|---|---|
| Sending simple JSON data |
HTTPPost(
"https://example.com/api",
"application/json; charset=utf-8",
JSONPackage(
"key1", "value1",
"key2", "value2"
)
)
|
| Using in a button |
createButton(
1,
"Send Data",
"Sends data to the server",
HTTPPost(
"https://example.com/endpoint",
"application/json; charset=utf-8",
JSONPackage(
"projectID", projectGuid,
"username", getUserName()
)
),
"",
"",
"",
"Data successfully sent",
"",
"send"
)
|
Notes
- Ensure that the URL and payload are correct to avoid errors in the request.
- The function can send sensitive data to external servers. Carefully verify the target URL.
- This function is particularly useful for integrating with APIs and external workflows (e.g., Power Automate).
Comments
0 comments
Please sign in to leave a comment.