[fpc-pascal] Prorammatically sending file using HTTP POST?
sysrpl at gmail.com
Wed Apr 4 19:37:55 CEST 2018
Just a follow up, if care you get a response back from your POST, as in the
server says okay, you just use the same socket to read. Also, you might
need to call connect after you set the host:
// port 80 normally used for http
If the server accepted your POST, the response will start with 'HTTP 1.1
200 OK'#10, followed by some other headers. Socket Read might be named
Receive or Recv, depending on your client socket implementation of choice.
If you want to learn may, you may want to example my THttpClient object:
And also, here is an example of how to write an object oriented socket
class that wraps the traditional socket apis on all platforms:
If you look at that source you can also see how simple it is to add https
support to your socket.
Socket.Secure := True;
And finally, you don't need to use my github code. anyAclient socket class
for Pascal should work approximately the same.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal