Create a Base LinkedIn API Request
li_req.Rd
This function creates a pre-configured HTTP request object for interacting with the LinkedIn API. It sets the API endpoint version, essential headers, and includes authentication.
Value
An HTTP request object with default
headers and authentication configured,
which can be used with other httr2
methods to perform API queries.
Details
The function initializes a request targeting
the LinkedIn API's base URL
(https://api.linkedin.com
) and appends the
specified endpoint version to the URL path.
It sets headers for API versioning, protocol
compatibility, and Content-Type
.
Authentication is handled through
li_req_auth()
.
Examples
if (FALSE) { # \dontrun{
# Create a request with default settings
req <- li_req()
# Create a request object
req <- li_req(
endpoint_version = "v2",
token = Sys.getenv("LI_TOKEN")
)
} # }