resp_date {httr2} | R Documentation |
Extract request date from response
Description
All responses contain a request date in the Date
header; if not provided
by the server will be automatically added by httr2.
Usage
resp_date(resp)
Arguments
resp |
An HTTP response object, as created by |
Value
A POSIXct
date-time.
Examples
resp <- response(headers = "Date: Wed, 01 Jan 2020 09:23:15 UTC")
resp |> resp_date()
# If server doesn't add header (unusual), you get the time the request
# was created:
resp <- response()
resp |> resp_date()
[Package httr2 version 1.0.2 Index]