Set Header UrlFetch

Can I set the header of UrlFecth such as “Accept”: “text/plain”?
If I can, how did we do it?

Thanks for the answer.

This is not possible with only urlfetch. You would have to make a web page that Nightbot can visit with urlfetch and that performs the request with that header and returns the response.

If you can be more specific then I can make the web page for you.

Ahhh I see. No I want to use this API but the default is sending back html page instead of plain text it’s for a random joke API. I am just wondering about that :slight_smile:

Thanks for the answer.

The web page I’m describing would visit that random joke API with that header. It just acts as a proxy.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.