req_get_method: Get request method

View source: R/req-method.R

req_get_methodR Documentation

Get request method

Description

Defaults to GET, unless the request has a body, in which case it uses POST. Either way the method can be overridden with req_method().

Usage

req_get_method(req)

Arguments

req

A httr2 request object.

Examples

req <- request(example_url())
req_get_method(req)
req_get_method(req |> req_body_raw("abc"))
req_get_method(req |> req_method("DELETE"))
req_get_method(req |> req_method("HEAD"))

httr2 documentation built on Aug. 8, 2025, 7:52 p.m.