Mashvisor

FREEMIUM
(Ким) Mashvisor | Оновлено एक महीने पहले | Data
Популярність

9.1 / 10

Затримки

3,339ms

Рівень обслуговування

94%

Health Check

N/A

Повернутися до всіх обговорень

A few comments on the R httr code | x_rapidapi and an issue with parentheses

Rapid account: Jared A Steinmetz
jared.a.steinmetz
3 वर्ष पहले

Issue One: Parentheses

On every R code snippet provided by this RapidAPI page there is a misplaced parentheses. This is the code:

response <- VERB("GET", url, add_headers(x_rapidapi-key = 'RapidAPI Key REMOVED', x_rapidapi-host = 'mashvisor-api.p.rapidapi.com', '), query = queryString, content_type("application/octet-stream"))

The final parentheses before the closing bracket of function add_header() fucks up the code.

Issue 2: = signs

In the code theres a few occasions where one = is used when in R syntax it should be ==.

response <- VERB("GET", url, add_headers(x_rapidapi-key = 'RapidAPI Key REMOVED', x_rapidapi-host = 'mashvisor-api.p.rapidapi.com', ), query = queryString, content_type("application/octet-stream"))

should become

response <- VERB("GET", url, add_headers(x_rapidapi-key == 'RapidAPI Key REMOVED', x_rapidapi-host == 'mashvisor-api.p.rapidapi.com', ), query == queryString, content_type("application/octet-stream"))

Issue 3: x_rapidapi not recognized.

Whenever I run the code with the parentheses and == corrections, I get a return result that reads: Error in named(list(...)) : object 'x_rapidapi' not found

I’ve tried looking through httr documentation and I can’t figure out an answer. It seems that this might be a Rapid API issue and not an httr issue. Any thoughts on how I can get this code to run?

Rapid account: Rapidtom
rapidtom Commented 3 वर्ष पहले

The code snippet is generated by RapidAPI and does have errors. Try using this instead:

response <- VERB("GET", url, add_headers('x-rapidapi-key' = 'API KEY GOES HERE', 'x-rapidapi-host' = 'mashvisor-api.p.rapidapi.com'), query = queryString, content_type("application/octet-stream"))

Приєднуйтесь до обговорення — додайте повідомлення нижче:

Вхід / Реєстрація, щоб публікувати нові повідомлення