question

bfg avatar image
bfg asked

How to read http.request headers

I'm trying to access the headers from the http.request, but having trouble accessing the headers.

Using

var responseString = http.request(url,method,contentBody,contentType,headers);

and everything works and I receive the body. How can I access headers?

Thanks!

webhooks
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
JayZuo avatar image
JayZuo answered

It seems you want to read response headers when using http.request in Cloud Script. If so, then unfortunately we can not get the response headers. As the document said, http.request will only return the body of the response in stringified form. May I know why you want to read the response headers? If you can control the response body, you can put the headers into response body.

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

bfg avatar image bfg commented ·

Thanks for the response. I'm using a third party OAuth and I need access to the response headers. I can't control the response body.

Is there any other way I can do this in Cloud Script?

0 Likes 0 ·
bfg avatar image bfg commented ·

@brendan can you help us with this?

0 Likes 0 ·
brendan avatar image brendan bfg commented ·

Sorry, but this thread would still be accurate (https://community.playfab.com/questions/13006/is-there-any-way-to-get-whole-httpresult-object-th.html). We've had very few requests for this, so I'm afraid returning more than the result body isn't something we've been able to invest resources in.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.