Replicating a ping request from curl cmmand using the httr package

I have some trouble replicating some curl command in the r package httr:

Unfortunately I cannot provide reproducible example as it is within a secured network. But I hope the comparison of the curl request and httr request allows for some analysis.

This is the curl command, working fine:

curl --location --request GET 'https://test.com:443/a/b/ping' --header 'system-auth: __token1__' --header 'Authorization: __token2__'

I try to replicate this behavior using the httr package:

endpoint = "/a/b/ping"
proxy <- "https://test.com:443"
token1 <- "__token1__"
token2 <- "__token2__"

header <- httr::add_headers(.headers = c("system-auth" = token1, "Authorization" = token2))
result <- httr::GET(paste0(proxy, endpoint), header = header)

With the httr request I receive the following error:

* OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104
* stopped the pause stream!
* Closing connection 0
Error in curl::curl_fetch_memory(url, handle = handle) : 
  OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104

So I am looking for ideas how to change the httr request to make it work or an explanation why the result of the curl command and the request via httr differ.

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