2 // Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // Official repository: https://github.com/boostorg/beast
10 #ifndef BOOST_BEAST_HTTP_VERB_HPP
11 #define BOOST_BEAST_HTTP_VERB_HPP
13 #include <boost/beast/core/detail/config.hpp>
14 #include <boost/beast/core/string.hpp>
21 /** HTTP request method verbs
23 Each verb corresponds to a particular method string
24 used in HTTP request messages.
28 /** An unknown method.
30 This value indicates that the request method string is not
31 one of the recognized verbs. Callers interested in the method
32 should use an interface which returns the original string.
36 /// The DELETE method deletes the specified resource
39 /** The GET method requests a representation of the specified resource.
41 Requests using GET should only retrieve data and should have no other effect.
45 /** The HEAD method asks for a response identical to that of a GET request, but without the response body.
47 This is useful for retrieving meta-information written in response
48 headers, without having to transport the entire content.
52 /** The POST method requests that the server accept the entity enclosed in the request as a new subordinate of the web resource identified by the URI.
54 The data POSTed might be, for example, an annotation for existing
55 resources; a message for a bulletin board, newsgroup, mailing list,
56 or comment thread; a block of data that is the result of submitting
57 a web form to a data-handling process; or an item to add to a database
61 /** The PUT method requests that the enclosed entity be stored under the supplied URI.
63 If the URI refers to an already existing resource, it is modified;
64 if the URI does not point to an existing resource, then the server
65 can create the resource with that URI.
69 /** The CONNECT method converts the request connection to a transparent TCP/IP tunnel.
71 This is usually to facilitate SSL-encrypted communication (HTTPS)
72 through an unencrypted HTTP proxy.
76 /** The OPTIONS method returns the HTTP methods that the server supports for the specified URL.
78 This can be used to check the functionality of a web server by requesting
79 '*' instead of a specific resource.
83 /** The TRACE method echoes the received request so that a client can see what (if any) changes or additions have been made by intermediate servers.
125 // RFC-2068, section 19.6.1.2
131 /** Converts a string to the request method verb.
133 If the string does not match a known request method,
134 @ref verb::unknown is returned.
137 string_to_verb(string_view s);
139 /// Returns the text representation of a request method verb.
143 /// Write the text for a request method verb to an output stream.
146 operator<<(std::ostream& os, verb v)
148 return os << to_string(v);
155 #include <boost/beast/http/impl/verb.ipp>