Make an HTTP POST request to any URL. Optionally configure query string parameters, headers and basic auth.
The URL you'd like to send the HTTP request to
The body of the HTTP request. Enter a static value or reference prior step exports via the steps
object (e.g., {{steps.foo.$return_value}}
).
Add individual query parameters as key-value pairs or disable structured mode to pass multiple key-value pairs as an object.
Add individual HTTP headers as key-value pairs or disable structured mode to pass multiple key-value pairs as an object.
To use HTTP basic authentication, enter a username and password separated by |
(e.g., myUsername|myPassword
).
auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps, auths) => {
}
import axios from "axios";
// Make an HTTP GET request using axios
const resp = await axios({
method: "GET",
url: `https://script.google.com/macros/s/AKfycbxHgN8bF08Ja4h0BNUNBCoumIjk_L2T2BQpsrL80-gsUJ1DcNsDVN-KtuA0OWYxZViX/exec`,
params: {
id:steps.post_request.$return_value.buyers[0].id
}
});
// Retrieve just the data from the response
const { data } = resp;
await $respond({
immediate: true,
status: 302,
headers: { "Location": data }
});