HTTPrequest Error 4844 "Unable to establish connection..."

Hi there,

I get the following error whenever I try a HttpReq.Get

4844 - Unable to establish connection to remote server, please enable debug trace setting Debug_NotesHTTPRequest for more information

If I use the same URL in the browser, it works like a charm !

Any ideas which interpretations this error has and could have ?

...
Set WebReq =Session.CreateHttpRequest
webReq.maxredirects= 5	
WebReq.Setheaderfield "Authorization", "Basic " & §.Base64Encode(user$ &":"& pw$)
...
v = webreq.Get("https://" & url$) '<--- Error happens here
headers = webReq.GetResponseHeaders
...

Sincerly

Jochen "Joe" Herrmann

* On a 12.0.2 FP4 client on Windoof 11 pro

Hello

It is the web server that is rejecting the request.
Therefore, it is necessary to investigate the reason why the web server is rejecting the request.
# The web server is not Domino, is it?

I think there is a difference in the HTTP headers compared to the request from the browser.
You may want to take a trace once using Debug_NotesHTTPRequest=1.

Regards,

Shigemitsu Tanaka

Hello @Shigemitsu Tanaka

good to know that this error reflects that the webserver (no Domino server) does not want to take my request. I already assumed that it might be a problem on our side.

I have already switched on Debug_NotesHTTPRequest=1

But I found nothing in the log.nsf.

Any ideas what it should report/log ?

Kind Regards,

Joe

Hi Joe,

Based on the code you shared, may you please share what is the value of url variable?

My guess the starting value of the url variable is "https://" as well. If so, concatenating it in the hard code using ("https://" & url$) will result to -> https://https://.......

I tried to simulate, and I reproduced it:

If that's the case, you need remove the hard code, and use v = webreq.Get(url$) only.

Hope this helps.

Thanks,

Jayve

Hello @Jayve Javier

thanks for your reply. The URL$ value is defined in a parameter document and there is no HTTPS//: in it . Just verified it, to be on the safe side.

So thanks for your reply,but it is not the problem

Kind Regards,

Joe

Hi Joe,

Thanks for checking. Please try to hard code the value, what will be the output? For example:

webreq.Get("https://api.zippopotam.us/us/90210/")

Thanks and best regards,

Jayve

Update:

The problem was that the website culd not be seen because the prefix www was not supported ... yeah, had to find this out now.

It is now working, but the return value I get from NotesHTTPRequest (Preferstrings set - in the help with "Topic not found" described) is not accepted by the Json-Parser.

As I do not have the time to find out what is different in this NotesHTTPRequest result value now and documentation gives also no hint and I lost already quite some time ...

I switched back to

Set HTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0")
HTTP.open "GET", URL
HTTP.SetRequestHeader "Authorization", "Basic " & USPW$   
HTTP.Send
...
Ret=HTTP.responseText
...

and this one works !

Kind Regards

Joe

Thanks for sharing this and appreciate your update Joe. That's great to hear.