File: req_method.Rd

package info (click to toggle)
r-cran-httr2 1.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,684 kB
  • sloc: sh: 13; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 726 bytes parent folder | download | duplicates (3)
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/req-method.R
\name{req_method}
\alias{req_method}
\title{Set HTTP method in request}
\usage{
req_method(req, method)
}
\arguments{
\item{req}{A httr2 \link{request} object.}

\item{method}{Custom HTTP method}
}
\value{
A modified HTTP \link{request}.
}
\description{
Use this function to use a custom HTTP method like \code{HEAD},
\code{DELETE}, \code{PATCH}, \code{UPDATE}, or \code{OPTIONS}. The default method is
\code{GET} for requests without a body, and \code{POST} for requests with a body.
}
\examples{
request(example_url()) |> req_method("PATCH")
request(example_url()) |> req_method("PUT")
request(example_url()) |> req_method("HEAD")
}