Response token from the url that gives a status code

36 Views Asked by At

Using "rtweet" rPackage. Is there a way to get the response status of a query while fetching tweets from the twitter API?

Something similar to the following :

library(httr)
github_api <- function(path) {
  url <- modify_url("https://api.github.com", path = path)
  GET(url)
}

resp <- github_api("/repos/hadley/httr")
resp
#> Response [https://api.github.com/repositories/2756403]
#>   Date: 2019-07-30 13:44
#>   **Status: 200**
#>   Content-Type: application/json; charset=utf-8
#>   Size: 6.04 kB
#> {
#>   "id": 2756403,
#>   "node_id": "MDEwOlJlcG9zaXRvcnkyNzU2NDAz",
#>   "name": "httr",
#>   "full_name": "r-lib/httr",
#>   "private": false,
#>   "owner": {
#>     "login": "r-lib",
#>     "id": 22618716,
#>     "node_id": "MDEyOk9yZ2FuaXphdGlvbjIyNjE4NzE2",
#> ...
0

There are 0 best solutions below