My suggestion is to change the URL to something you control, with http not https, and see how the requests differ using tcpdump. Here's what I get:
---- python3 ----
import requests
r=requests.get("http://localhost/foo", params = {'version':'5', "phoneList":"XXXXXX", "output":"json"}, headers={"loginId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX "}) print(r.status_code)
print(r.text)
-->
GET /foo?version=5&phoneList=XXXXXX&output=json HTTP/1.1
Host: localhost
User-Agent: python-requests/2.24.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
loginId: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
---- go 1.14.6 ----
-->
GET /foo HTTP/1.1
Host: localhost
User-Agent: Go-http-client/1.1
Loginid: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Accept-Encoding: gzip
So the first problem is that the URL query parameters are not getting encoded.
Uncommenting the line "req.URL.RawQuery = q.Encode()", I get:
-->
GET /foo?output=json&phoneList=XXXXXX&version=5 HTTP/1.1
Host: localhost
User-Agent: Go-http-client/1.1
Loginid: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Accept-Encoding: gzip
- with go, the response is a 200 OK with HTML containing login information
- with python, I get exactly the same
- with go the response is a 200 and a huge HTML/CSS page
- with python I get exactly the same
$ python3 test3.py | wc
1288 12333 241224
$ go run . | wc
1289 12336 241286
So I'm afraid I cannot see any difference between go and python, whereas you said "responses are totally different from two languages". If they are still different for you, this is weird.
For completeness, here are the last two programs I ran.
---- python3 ----