Reproduce a complex curl request with httr2 or httr

I usually scrape web pages with rvest::read_html(); however, this time I want to read an html page using a residential proxy:

Proxy username: username

Proxy password: password

Proxy hostname: (my residential proxy service)

Proxy port: port

Let's also assume that I'm trying to read the following web page:

The website for my residential proxy service provide the following curl request which works perfectly:

$ curl -v -x -L

where $ refers to a bash shell.

My goal is to reproduce this curl request using {httr} or {httr2}. Here is my (failed) attempt:

username <- "username"
password <- "password"
port <- "port"
url <- ""

req <- httr2::request(base_url = url) |>
      url = "",
      port = port,
      username = username,
      password = password,
      auth = "basic"

Thanks in advance for your help.

Fun timing, you might find your answer here or there.

1 Like

Well it seems that the flags used in the curl request are not currently supported. Thank you for showing those. Also @maelle did tell me about curl_translate().

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.