1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/request_class.R
\name{Request}
\alias{Request}
\title{The request of an HTTPInteraction}
\description{
object that handled all aspects of a request
}
\examples{
url <- "https://eu.httpbin.org/post"
body <- list(foo = "bar")
headers <- list(
`User-Agent` = "libcurl/7.54.0 r-curl/3.2 crul/0.5.2",
`Accept-Encoding` = "gzip, deflate",
Accept = "application/json, text/xml, application/xml, */*"
)
(x <- Request$new("POST", url, body, headers))
x$body
x$method
x$uri
x$host
x$path
x$headers
h <- x$to_hash()
x$from_hash(h)
}
\keyword{internal}
\section{Public fields}{
\if{html}{\out{<div class="r6-fields">}}
\describe{
\item{\code{method}}{(character) http method}
\item{\code{uri}}{(character) a uri}
\item{\code{scheme}}{(character) scheme (http or https)}
\item{\code{host}}{(character) host (e.g., stuff.org)}
\item{\code{path}}{(character) path (e.g., foo/bar)}
\item{\code{query}}{(character) query params, named list}
\item{\code{body}}{(character) named list}
\item{\code{headers}}{(character) named list}
\item{\code{skip_port_stripping}}{(logical) whether to strip thhe port}
\item{\code{hash}}{(character) a named list - internal use}
\item{\code{opts}}{(character) options - internal use}
\item{\code{disk}}{(logical) xx}
\item{\code{fields}}{(various) request body details}
\item{\code{output}}{(various) request output details, disk, memory, etc}
}
\if{html}{\out{</div>}}
}
\section{Methods}{
\subsection{Public methods}{
\itemize{
\item \href{#method-new}{\code{Request$new()}}
\item \href{#method-to_hash}{\code{Request$to_hash()}}
\item \href{#method-from_hash}{\code{Request$from_hash()}}
\item \href{#method-clone}{\code{Request$clone()}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-new"></a>}}
\if{latex}{\out{\hypertarget{method-new}{}}}
\subsection{Method \code{new()}}{
Create a new \code{Request} object
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{Request$new(method, uri, body, headers, opts, disk, fields, output)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{method}}{(character) the HTTP method (i.e. head, options, get,
post, put, patch or delete)}
\item{\code{uri}}{(character) request URI}
\item{\code{body}}{(character) request body}
\item{\code{headers}}{(named list) request headers}
\item{\code{opts}}{(named list) options internal use}
\item{\code{disk}}{(boolean), is body a file on disk}
\item{\code{fields}}{(various) post fields}
\item{\code{output}}{(various) output details}
}
\if{html}{\out{</div>}}
}
\subsection{Returns}{
A new \code{Request} object
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-to_hash"></a>}}
\if{latex}{\out{\hypertarget{method-to_hash}{}}}
\subsection{Method \code{to_hash()}}{
Convert the request to a list
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{Request$to_hash()}\if{html}{\out{</div>}}
}
\subsection{Returns}{
list
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-from_hash"></a>}}
\if{latex}{\out{\hypertarget{method-from_hash}{}}}
\subsection{Method \code{from_hash()}}{
Convert the request to a list
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{Request$from_hash(hash)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{hash}}{a list}
}
\if{html}{\out{</div>}}
}
\subsection{Returns}{
a new \code{Request} object
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-clone"></a>}}
\if{latex}{\out{\hypertarget{method-clone}{}}}
\subsection{Method \code{clone()}}{
The objects of this class are cloneable with this method.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{Request$clone(deep = FALSE)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{deep}}{Whether to make a deep clone.}
}
\if{html}{\out{</div>}}
}
}
}
|