make_post_request {sched} | R Documentation |
Make a POST request.
Description
Construct a sched::Request object with a valid header for a POST request.
Usage
make_post_request(url, body, mime, soap_action = NULL, encoding = NULL)
Arguments
url |
A |
body |
The body of the POST request. |
mime |
The MIME type of the body. Example: "text/xml", "application/json". |
soap_action |
In case of a SOAP request, the SOAP action to contact, as a character string. |
encoding |
The encoding to use. A valid integer or string as required by RCurl. |
Value
A sched::Request object.
Examples
# Prepare the URL and the request body
the_url <- sched::URL$new('https://httpbin.org/anything')
the_body <- '{"some_key": "my_value"}'
# Make the request object
my_request <- sched::make_post_request(the_url, body = the_body,
mime = "application/json")
[Package sched version 1.0.1 Index]