Questions tagged [httr]

The R package 'httr' provides useful tools for working with HTTP connections. It is a simplified wrapper built on top of 'RCurl'.

The R package httr provides useful tools for working with HTTP connections. It is a simplified wrapper built on top of RCurl. It is much much less configurable but because it only attempts to encompass the most common operations it is also much much simpler.

Resources:

1019 questions
4
votes
1 answer

POST request with httr package using R

I would like to get the output from POST request using httr from following site: http://www.e-grunt.ba You can see submit form when you click "ZK Ulošci". There I would like to send POST request and get the output. For example, you can select…
Mislav
  • 1,533
  • 16
  • 37
4
votes
2 answers

Download CSV file from results page with options from dropdown menu

I am a novice at web scraping with R and I am stuck on this problem: I want to use R to submit a search query to PubMed, then download a CSV file from the results page. The CSV file can be accessed by clicking 'Send to', which opens a dropdown menu,…
kstew
  • 1,104
  • 6
  • 21
4
votes
1 answer

Accept gzip encoding using httr R

I subscribe to a financial data provider ORATS. The software engineer reached out to me to let me know my GET() requests are timing out. He said to allow gzip encoding in my GET() request header. The SWE does not code in R and has sent me some…
Jordan Wrong
  • 1,205
  • 1
  • 12
  • 32
4
votes
1 answer

R httr GET request - connection time-out

I am trying to download programmatically files like this from an ftp. The home page provides openly username ("fire") and password ("burnt") and I can download the files no problem from browser. When I try to do the same in R using…
Claudia
  • 996
  • 1
  • 10
  • 27
4
votes
3 answers

Error in curl - SSL certificate problem: unable to get local issuer certificate

I am having difficulty with a GET call that pings the US Naval Observatory API. This request was previously working, but now is failing for unknown reasons. Here's the request: library(httr) #ping API try(RETRY("GET", url =…
griffmer
  • 357
  • 2
  • 9
4
votes
1 answer

Connecting to Youtube Analytics API using R

I am trying to pull data from Youtube Analytics API using R and have hit a wall. I'm getting a Status 403 error. I can confirm that: I have tried logging out of all accounts, rebooting, re-authenticating and then logging into 1 account and it…
Duke
  • 163
  • 8
4
votes
1 answer

How to scrape JavaScript rendered Website by R?

Just wanna ask if there is any good approach to scrape the website below? https://list.jd.com/list.html?cat=737,794,798&page=1&sort=sort_rank_asc&trans=1&JL=6_0_0#J_main Basically I want to get the name and price of all products However, the price…
Terrence
  • 41
  • 3
4
votes
0 answers

How to set httr-oauth of send_message gmailr R?

send_message(mime(from="you@me.com", to="any@one.com", subject="hello", "how are you doing?")) it will ask for authentication, if will not find .httr-oauth in the current working directory, is there any away to direct R to look…
Mohamed
  • 95
  • 7
4
votes
1 answer

Get and set cookies in rvest

How can I check my session cookies and specify those cookies before making a subsequent web request? I want to scrape a page but I cannot submit the cookies. I'm using the rvest library. My code: library(rvest) WP <-…
AgnieszkaTomczyk
  • 253
  • 2
  • 12
4
votes
1 answer

--user curl equivalent in httr

This is, I presume, some really simple curl code that I am trying to translate into a httr format. curl -X POST \ --user ':' \ --header 'user-key: ' \ --url https://api.m.com/v1/clients So far I have tried…
FilipW
  • 1,412
  • 1
  • 13
  • 25
4
votes
1 answer

How to upload a pdf by sending a POST Request to an API

I have tried to upload a pdf by sending a POST Request to an API in R and in Python but I am not having a lot of success. Here is my code in R library(httr) url <- "https://envoc-apply-api.azurewebsites.net/api/apply" POST(url, body =…
Dre
  • 713
  • 1
  • 8
  • 27
4
votes
0 answers

instaR http error 400, can't get access token

i've been trying to use instaR, but failed at getting an access token - getting the response: Authentication complete. Error in init_oauth2.0(self$endpoint, self$app, scope = self$params$scope, : Bad Request (HTTP 400). Failed to get an access…
stedogin
  • 61
  • 6
4
votes
2 answers

R - curl - download remote file only when changed

For a project I need to download regularly data files from different websites to create an indicator based on those files. As the update frequency of those files varies a lot, I am looking for an efficient way to detect whether a remote file was…
Lod
  • 609
  • 7
  • 19
4
votes
1 answer

httr and Accept-Encoding: gzip, deflate

I want to do the following call in R: curl "http://www.openml.org/api/v1/task/list/limit/3000?api_key=c1994bdb7ecb3c6f3c8f3b35f4b47f1f" -H "Accept-Encoding: gzip, deflate" The line above returns a gzip compressed string. But when I use the httr…
Giuseppe
  • 786
  • 1
  • 7
  • 18
4
votes
1 answer

R - Write a HTML file from URL/HTML Object/HTML Response

I want to save a HTML file using a URL from R. I have tried to save the response object(s) after using GET and read_html functions of httr and rvest packages respectively, on the URL of the website, I want to save the HTML of. But that didn't work…
RNoobie
  • 41
  • 1
  • 3