Closed gadepallivs closed 4 years ago
Hi,
First advice, in case it is the good one, do not leave your password out in the open like that, even if website is not accessible from us directly!
For your issue, do you have some documentation about your API regarding how the authentication mechanism work ? Currently you are giving the request your authentication twice and maybe that could create some conflicts:
httr::authenticate
Are both of them required ? The second one may be enough. What does the doc of your API saying about authentication? Do you have the working python code ?
This type of question is best suited for a Q&A website like https://community.rstudio.com. There is a large community ready to help there. Github is more suited for bugs or feature requests.
Thank you for the advice, corrected it. I do have the working python . I tried without passing password and it did not work.
import http.client
conn = http.client.HTTPSConnection("test-web-vt02.com")
headers = {
'content-type': "application/json",
'authorization': "Basic *****"
}
conn.request("GET", "url/parameterstosearch", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
For reference, this as been cross-post on the community https://community.rstudio.com/t/authentication-information-not-present/42594
I am testing an internal FHIR api, to pull the data into R. This is a test environment with basic HTTP authentication. It works when I try with python
http.client.HTTPSConnection
. Also works with API tested online. I am not sure what I am missing when using the httr package in R.I get the following message"Authentication information not present or not in the correct format"
. Appreciate your help