Sending headers via http?

Just starting out? Need help? Post your questions and find answers here.
vwidmer
Enthusiast
Enthusiast
Posts: 282
Joined: Mon Jan 20, 2014 6:32 pm

Sending headers via http?

Post by vwidmer »

Is it possible to send headers with http requests?

I would like to send:
"Origin"
"Referer"

Is there some way to do that?
Thanks
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA
User avatar
kpeters58
Enthusiast
Enthusiast
Posts: 341
Joined: Tue Nov 22, 2011 5:11 pm
Location: Kelowna, BC, Canada

Re: Sending headers via http?

Post by kpeters58 »

Yes, easily. Look at the webserver code in your PB examples directory for inspiration.
PB 5.73 on Windows 10 & OS X High Sierra
vwidmer
Enthusiast
Enthusiast
Posts: 282
Joined: Mon Jan 20, 2014 6:32 pm

Re: Sending headers via http?

Post by vwidmer »

Looks like I maybe dont have webserver code in my examples directory. Can you please point me a link or post the code for me.

Thanks
kpeters58 wrote:Yes, easily. Look at the webserver code in your PB examples directory for inspiration.
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA
wombats
Enthusiast
Enthusiast
Posts: 663
Joined: Thu Dec 29, 2011 5:03 pm

Re: Sending headers via http?

Post by wombats »

It's under Examples/Sources - Advanced/Atomic Web Server in the PureBasic directory.
vwidmer
Enthusiast
Enthusiast
Posts: 282
Joined: Mon Jan 20, 2014 6:32 pm

Re: Sending headers via http?

Post by vwidmer »

Strange I dont see it in the linux latest releases.
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA
wombats
Enthusiast
Enthusiast
Posts: 663
Joined: Thu Dec 29, 2011 5:03 pm

Re: Sending headers via http?

Post by wombats »

You're right...that's weird. I would post it here, but I'm not sure if that's allowed.

Anyway, I found an example on PureArea.net in the CodeArchive: http://purearea.net/pb/CodeArchiv/Inter ... bserver.pb
Post Reply