httr GET hanging with no response:

Continuing the discussion from httr GET hanging with no response:

Was there any understanding on this issue?

It works in python but times out in R.

R chunk in Rstudio:

library(httr)

resp <- GET(
    url = "https://www.cmegroup.com/",
    user_agent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36'),
    timeout(10),
    verbose()
)

print(resp)

Times out
Timeout value was also increased but no success.

Error in curl::curl_fetch_memory(url, handle = handle) : 
Timeout was reached: [www.cmegroup.com] Operation timed out after 10005 milliseconds with 0 bytes received

This is the python chunk in Rstudio:

import requests as r

resp = r.get(
    "https://www.cmegroup.com/",
    headers = {'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36'},
    timeout = 10
)

print(len(resp.content))

Success:
579810

As i was adding tags to this query I saw "httr2" as another package!

Hence tried the following with "httr2" and same results, it just keeps doing something and no response/output.

request("https://www.cmegroup.com/") %>% req_user_agent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36') %>% req_perform()

This topic was automatically closed 21 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.