Malloy
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Functions
malloy::http Namespace Reference

Namespaces

namespace  filters
 Contains the filter types bundled with malloy.
 

Classes

class  cookie
 
class  cookie_clear
 
class  generator
 
class  request
 
class  response
 

Typedefs

using method = boost::beast::http::verb
 
using status = boost::beast::http::status
 
using field = boost::beast::http::field
 
using fields = boost::beast::http::fields
 
template<typename Fields = fields>
using request_header = boost::beast::http::request_header< Fields >
 
template<typename Fields = fields>
using response_header = boost::beast::http::response_header< Fields >
 

Functions

template<typename Body >
std::optional< request< Body > > build_request (const method method_, const boost::urls::url &url)
 
template<typename Body >
std::optional< request< Body > > build_request (const method method_, const std::string_view &url)
 
template<bool isReq, typename Fields >
std::string_view resource_string (const boost::beast::http::header< isReq, Fields > &header)
 
template<bool isReq, typename Fields >
void chop_resource (boost::beast::http::header< isReq, Fields > &head, std::string_view resource)
 
template<bool isReq, typename Fields >
bool has_field (const boost::beast::http::header< isReq, Fields > &head, const malloy::http::field check)
 
std::vector< std::string_view > split_header_value (std::string_view field_value)
 
template<bool isReq, typename Fields >
std::optional< std::string_view > cookie_value (const boost::beast::http::header< isReq, Fields > &header, const std::string_view cookie_name)
 

Detailed Description

A namespace for everything related to HTTP.

Typedef Documentation

◆ field

using malloy::http::field = typedef boost::beast::http::field

The HTTP field.

◆ fields

using malloy::http::fields = typedef boost::beast::http::fields

The HTTP fields

◆ method

using malloy::http::method = typedef boost::beast::http::verb

The HTTP method.

◆ request_header

template<typename Fields = fields>
using malloy::http::request_header = typedef boost::beast::http::request_header<Fields>

HTTP request header.

◆ response_header

template<typename Fields = fields>
using malloy::http::response_header = typedef boost::beast::http::response_header<Fields>

HTTP response header.

◆ status

using malloy::http::status = typedef boost::beast::http::status

The HTTP status.

Function Documentation

◆ cookie_value()

template<bool isReq, typename Fields >
std::optional< std::string_view > malloy::http::cookie_value ( const boost::beast::http::header< isReq, Fields > &  header,
const std::string_view  cookie_name 
)

Extracts a cookie value (if any).

Template Parameters
isReq
Fields
Parameters
headerThe HTTP header.
cookie_nameThe cookie name.
Returns
The cookie value (if any).
Here is the call graph for this function:

◆ split_header_value()

std::vector< std::string_view > malloy::http::split_header_value ( std::string_view  field_value)
inline

Split a header value into its individual parts.

Example: input: "multipart/form-data; boundary=----WebKitFormBoundarynBjZTMv9eqwyCWhj" output:

  • "multipart/form-data"
  • "boundary=----WebKitFormBoundarynBjZTMv9eqwyCWhj"
Parameters
field_valueThe value to split.
Returns
The split values
See also
malloy::split(std::string_view, std::string_view)
Here is the call graph for this function: