Description Usage Arguments Details Value Examples
.GetHTTP is an internal function that is not intended to be called by the user. .GetHTTP is called by other FIRST API methods.
1 |
session |
A Session object created with |
url |
A character vector containing a partial FIRST API url. The url
argument includes everything to the right of the season. For example,
|
.GETHTTP is a crucial function – it does most of the work for the firstapiR
publicly accessible functions. It formulates the HTTP request from the
url
and session
arguments, including final assembly on the url
and creating the authorization header. It verifies there are no HTTP errors
on the response and checks the response content for properly formatted JSON
or XML text. Finally, if a data frame is requested, it converts the response
to an R data frame.
.GetHTTP will thow an error if any HTTP code other than 200 is received in the HTTP response. The error message will include the error code and the error message from the response content. See the Response Codes section of the FIRST API documentation for additional details.
.GetHTTP will also throw an error if session$format = "data.frame" and no records are returned.
Returns either JSON text, an XML::XMLNode object, or an R data frame, depending on the value of session$format.
1 2 | sn <- GetSession("username", "key")
.GetHTTP(sn, "events?teamNumber=2557&districtCode=PNW")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.