HTTP request string
-
DaylightDreamer
- User

- Posts: 52
- Joined: Wed Feb 04, 2009 8:11 am
- Location: Armenia
HTTP request string
Is it possible to retrieve the HTTP request as string without actually storing its content in a file first ?
Something to make POST requests would be also very nice.
Something to make POST requests would be also very nice.
- RichAlgeni
- Addict

- Posts: 935
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: HTTP request string
Yes, but you will need to write the code to receive the request, to replace the code that writes it to a file.
Writing POST requests are similar to GET requests. Before we jump in and overwhelm you with code, have you written a GET request before? Have you written any network code?
Writing POST requests are similar to GET requests. Before we jump in and overwhelm you with code, have you written a GET request before? Have you written any network code?
- RichAlgeni
- Addict

- Posts: 935
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: HTTP request string
To the moderator: this thread should probably should be in Coding Questions.
Re: HTTP request string
http://www.purebasic.fr/english/viewtop ... 12&t=44954DaylightDreamer wrote:Is it possible to retrieve the HTTP request as string without actually storing its content in a file first ?
Greetings ... Kiffi
Hygge
-
DaylightDreamer
- User

- Posts: 52
- Joined: Wed Feb 04, 2009 8:11 am
- Location: Armenia
Re: HTTP request string
Hello,
Yes I`m aware of this examples. And yes I`m familiar with the request format.
However I`m talking about the native support on memory level (to be able to write a versatile client server applications base on just web server)
Also i don't think these examples are covering HTTPS support.
Yes I`m aware of this examples. And yes I`m familiar with the request format.
However I`m talking about the native support on memory level (to be able to write a versatile client server applications base on just web server)
Also i don't think these examples are covering HTTPS support.
-
DaylightDreamer
- User

- Posts: 52
- Joined: Wed Feb 04, 2009 8:11 am
- Location: Armenia
Re: HTTP request string
But thanks for the example.
-
DaylightDreamer
- User

- Posts: 52
- Joined: Wed Feb 04, 2009 8:11 am
- Location: Armenia
Re: HTTP request string
For example GetHTTPHeader(URL$) function gets the header of specifed url.
It shouldn't be difficult to ad additional parameter to this function to retrieve the entire http package.
It shouldn't be difficult to ad additional parameter to this function to retrieve the entire http package.
- RichAlgeni
- Addict

- Posts: 935
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: HTTP request string
Take a look at this:
http://www.purebasic.fr/english/viewtop ... 12&t=51072
This will show you how to use native PB and windows code to read a socket into memory. This will include the entire packet sent in by a browser, not just the header. Is this what you are asking for?
Let me know if you have any questions.
Rich
http://www.purebasic.fr/english/viewtop ... 12&t=51072
This will show you how to use native PB and windows code to read a socket into memory. This will include the entire packet sent in by a browser, not just the header. Is this what you are asking for?
Let me know if you have any questions.
Rich
-
DaylightDreamer
- User

- Posts: 52
- Joined: Wed Feb 04, 2009 8:11 am
- Location: Armenia
Re: HTTP request string
Yes this is it.
However i need a pretty stable solution with HTTPS support.
However i need a pretty stable solution with HTTPS support.
- RichAlgeni
- Addict

- Posts: 935
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: HTTP request string
This is what I would do (and have done), and in my opinion, is the best way (and easiest) to do a Secure Sockets Layer (SSL) Server. Utilize a proxy server process like Apache, running on a machine that is accessible to the internet. Your PureBasic Server process will be running on a separate machine, connected to the proxy server machine via a non-routeable IP address, like 192.169.1.x. Apache will handle the 'secure' part of the connection, and forward requests to the PureBasic server. The PB server will fulfill the requests, sending data back out through the proxy server.
This solves a number of problems, not the least of which is that writing an SSL is extremely complicated! This also adds a layer of security as your main server is not accessible itself on the internet.
This solves a number of problems, not the least of which is that writing an SSL is extremely complicated! This also adds a layer of security as your main server is not accessible itself on the internet.
-
DaylightDreamer
- User

- Posts: 52
- Joined: Wed Feb 04, 2009 8:11 am
- Location: Armenia
Re: HTTP request string
Yes i`m aware of that thank you.
Also i was thinking of using a hidden WebGadget to make this interchange.
But not sure if it will work.
Also i was thinking of using a hidden WebGadget to make this interchange.
But not sure if it will work.