Having your question only in the title without adding context in the post severely limits the help you can get from the community. Try to add more context, like where are you putting this code, where do you want to use the headers (next step of workflow maybe?) etc.
If this is code in a js action you should know that you are practically writing the body of an async function, so you can use async/await and return data from the headers (instead of the axios promise) so that is available in the next step.
I pasted js code for better understanding.
I want response header from rest api call. but I found no option for it.
for now I am using this js code to get headers, but it is not working fine.
Therefore I want response headers from rest api
In your first post you are using custom js, just in the wrong way. You need to await the response and then return the headers. If you want a nocode way to make a request have a look to REST API data source | WeWeb documentation
I know I am using js in the wrong way, that’s why I am asking for a correct way.
In your documentation there is no information about getting response headers.
this is my ret api request ,
that is running successfully but form recognizer only sent response headers as its output.
where do I found response header
All right, your question is about making a request and getting the headers, you want to do it in a nocode way, you pasted the code in your post not because you are using it but only because you have that as a guide. Right?
Collections are a special class of requests in weweb and they are used for data.
To get the headers you need to use the “REST API Request” action. Set it up and then test it while in edit mode. Now you can access the result of the action, including headers, in your next steps.