-
Hey guys, I'm trying to make a GET request & capture the response body and headers at the same time. But, depending on the order of builder, I'm failing to capture one of them. requests.URL("/simple").
Bearer(token).
ContentType("application/json").
ToHeaders(headers).
ToJSON(&response).
Method("GET").
Fetch(ctx) This request is successful but requests.URL("/simple").
Bearer(token).
ContentType("application/json").
ToJSON(&response).
ToHeaders(headers).
Method("GET").
Fetch(ctx) Here, I can capture Is this considered a bug? What is a good way to capture both headers and response body? |
Beta Was this translation helpful? Give feedback.
Answered by
mtyurt
Sep 14, 2023
Replies: 1 comment
-
Okay, found the answer on my own. I should have used requests.URL("/simple").
Bearer(token).
ContentType("application/json").
ToJSON(&response).
CopyHeaders(headers).
Method("GET").
Fetch(ctx) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mtyurt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Okay, found the answer on my own. I should have used
CopyHeaders