From 749cbb2ff8ad38bdd9abf777bf2065cbf9f93cfe Mon Sep 17 00:00:00 2001 From: firefly2442 Date: Thu, 1 Nov 2012 21:12:38 -0500 Subject: [PATCH] add HTTP support for PUT and DELETE Signed-off-by: binary1248 --- include/SFML/Network/Http.hpp | 8 +++++--- src/SFML/Network/Http.cpp | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/SFML/Network/Http.hpp b/include/SFML/Network/Http.hpp index 4b962acd..09e577bf 100644 --- a/include/SFML/Network/Http.hpp +++ b/include/SFML/Network/Http.hpp @@ -61,9 +61,11 @@ public : //////////////////////////////////////////////////////////// enum Method { - Get, ///< Request in get mode, standard method to retrieve a page - Post, ///< Request in post mode, usually to send data to a page - Head ///< Request a page's header only + Get, ///< Request in get mode, standard method to retrieve a page + Post, ///< Request in post mode, usually to send data to a page + Head, ///< Request a page's header only + Put, ///< Request in put mode, useful for a REST API + Delete ///< Request in delete mode, useful for a REST API }; //////////////////////////////////////////////////////////// diff --git a/src/SFML/Network/Http.cpp b/src/SFML/Network/Http.cpp index 6b56512d..998287b9 100644 --- a/src/SFML/Network/Http.cpp +++ b/src/SFML/Network/Http.cpp @@ -108,9 +108,11 @@ std::string Http::Request::prepare() const switch (m_method) { default : - case Get : method = "GET"; break; - case Post : method = "POST"; break; - case Head : method = "HEAD"; break; + case Get : method = "GET"; break; + case Post : method = "POST"; break; + case Head : method = "HEAD"; break; + case Put : method = "PUT"; break; + case Delete : method = "DELETE"; break; } // Write the first line containing the request type