Webservice server with PB

Just starting out? Need help? Post your questions and find answers here.
Marc56us
Addict
Addict
Posts: 1479
Joined: Sat Feb 08, 2014 3:26 pm

Webservice server with PB

Post by Marc56us »

Hi all,

I'm building a Webservice server (for my local network) with the internal functions of PB (CreateNetworkServer(), ReceiveNetworkData, SendNetworkString etc), it's quite simple (thank PB!) and it works very well.

However, I realize that in return (from HTTPRequest) I receive my informations very well in #PB_HTTP_Response, but that #PB_HTTP_ErrorCode always returns zero regardless of the connection or transfer status.

So I think that it is the server that explicitly creates this code and that in my server I must create it?

Question: under which syntax should the server response (via SendNetworkString() too, I think) be returned to be isolated in #PB_HTTP_ErrorCode?

I don't know if I express the problem well
(which is not a problem at the moment)

:wink:
infratec
Always Here
Always Here
Posts: 6874
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Webservice server with PB

Post by infratec »

Hi,

there is no special stuff.
Your code have to return the status in the first line:
HTTP/1.1 200 OK
followed by a CRLF
The number is the ststus/error.
Use wireshark to see what happens exactly.
Post Reply