From 08ed4a2354c40d10b0c6f0e8d5be117ed027df13 Mon Sep 17 00:00:00 2001 From: Fred Nicolson Date: Mon, 5 Jun 2017 13:36:09 +0100 Subject: [PATCH] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bbf7bca..768c512 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ fr::HttpRequest objects are used for dealing with data being sent *to* the serve #include //Connect to the website -fr::HttpSocket socket; +fr::HttpSocket socket; if(socket.connect("example.com", "80") != fr::Socket::Success) { //Failed to connect to site @@ -177,7 +177,7 @@ if(socket.receive(response) != fr::Socket::Success) //Print out the response std::cout << request.get_body() << std::endl; ``` -Here we create a fr::HttpSocket object, connect to a domain (don't include the 'http://' bit). SSL support is planned but not implemented just yet. After connecting, we construct a fr::HttpRequest object to send to the server, adding in some GET arguments, POST arguments and a request header. +Here we create a fr::HttpSocket object, connect to a domain (don't include the 'http://' bit). The socket is non-SSL and so the underlying socket type is fr::TcpSocket. If this were an SSL socket, then it'd be fr::HttpSocket. After connecting, we construct a fr::HttpRequest object to send to the server, adding in some GET arguments, POST arguments and a request header. You can both set and get GET/POST data through the fr::(HttpRequest/HttpResponse)::(get/post) functions. And access/set headers though the [] operator. Once we've sent a request, we wait for a response. Once received, we print out the body of the response and exit.