Add custom headers to HTTPRequest

Got an idea for enhancing SpiderBasic? New command(s) you'd like to see?
User avatar
SparrowhawkMMU
Posts: 281
Joined: Wed Aug 19, 2015 3:02 pm
Location: United Kingdom

Re: Add custom headers to HTTPRequest

Post by SparrowhawkMMU »

Many, many thanks Fred, got my API and SB front end talking to one another using auth tokens passed to the backend using the Authorization header :)

(I'm now also able to pass the X-Clacks-Overhead header which I try to add to all my front and backends where possible)
User avatar
SparrowhawkMMU
Posts: 281
Joined: Wed Aug 19, 2015 3:02 pm
Location: United Kingdom

Re: Add custom headers to HTTPRequest

Post by SparrowhawkMMU »

Just as an aside for others using this feature, you need to check the OPTIONS request first and ensure that you reply with the correctly configured Access-Control-Allow-Origin and Access-Control-Allow-Headers headers for this to work.

Your browser will only send the actual GET or POST request if it gets the all clear fro the OPTIONS request first
sculptorsjb
Posts: 3
Joined: Tue Dec 27, 2016 6:01 am

Re: Add custom headers to HTTPRequest

Post by sculptorsjb »

hi

The general gist of these posts suggest the problem of setting headers has been solved
but i Can't see how ? and the help file doesn't seem to explain how to use them.

so newby question

how do i set a custom header ?

cheers
steve
Fred
Site Admin
Posts: 1506
Joined: Mon Feb 24, 2014 10:51 am

Re: Add custom headers to HTTPRequest

Post by Fred »

Your can check the doc, there is an example with custom headers: http://www.spiderbasic.com/documentatio ... quest.html
Post Reply