This sounds like besides the user, password the system also requires a cookie being set.
As it looks like the communication uses http ( which seems a bit strange from security point of view ) you easily can sniff the network traffic by using either wireshark or an extension like HTTP header live ( for firefox ) and trace the network communication. This will show the cookies that are used.
Alternatively you may try to use curl and check if you get better results on the command line.
Browsers do have more intelligence in their code. E.g. they are able to deal with redirect requests.
Best would be to record the communication e.g. using a network sniffer or something like a browser plugin like http-header-live for firefox ( there are others as well ).
As long as it is http traffic you can do the following:
a) trace the traffic by running the connection in a browser
b) trace the traffic by running the connection from within openhab
c) compare results from a) and b) resp. b) against the specification do adjustments and run b) again.
To compare the traffic and its differences it may be better to use wireshark and tcpdump.
You can use wireshark on linux/windows. In case of a Pi you would use tcpdump and record the traffic into a file that can be copied to your PC running wireshark and then opened in wireshark.
An example http analysis with wireshark: HTTP analysis using Wireshark
In case https is being used the traffic will be encrypted and it is more effort/complex to decrypt the traffic.
The call from within openhab may be easy but first one needs to know what the problem is.
The browser does many things one after an other. I think the http action does just one and as long as it is not clear what is not working it needs to be analysed. Wireshark/tcpdump is about doing the analysis.
Alternatively you may check if you cam is supported by the ipcamera binding.
I have installed openhab 4 on a Synology Disk Station in a docker container. I also installed wireshark in a docker container but I’m not able to see the http traffic when I call the rule with the sendHttpGetRequest. Maybe it is because both run in docker containers.
I did install wireshark on my windows laptop and I did work like in firefox. I got the same result there.
So I guess I need to find the solution without wireshark on the openhab side.