When using @pipedream/platform axios, you can access the response headers by setting the returnFullResponse property to true in the axios config object. This will return the full axios response object, which includes the headers. Here’s an example of how you can do it: import { axios } from "@pipedream/platform"; export default { async run() { const response = await axios(this, { url: "https://httpbin.org/get", returnFullResponse: true, // This line is important }); console.log(response.headers); }, }; In this example, the console.log(response.headers); line will log the headers of the response.
Yes, you’re correct. In Pipedream code steps, the $ object is passed as the first argument to the axios call. This is because the axios method from @pipedream/platform uses methods provided by the $ object. Here’s an example: import { axios } from "@pipedream/platform" export default { async run({ $ }) { const response = await axios($, { url: "https://httpstat.us/200", returnFullResponse: true, // This line is important }); console.log(response.headers); }, }; In this example, the console.log(response.headers); line will log the headers of the response. The returnFullResponse: true line ensures that the full axios response object, including headers, is returned.