Hello! The question is probably stupid and perhaps trivial, but I just can not figure it out and ask for your help. Trying to access the API https://russia.travel/apidoc/access/ using Go. Quote:
Russia.Travel API works via the HTTP protocol, through which all requests must be sent using the POST method to the address http://api.russia.travel/ . Requests sent must contain three required parameters:
login containing user login; hash containing the user password hash; An xml containing the body of the request in XML format according to the documentation.
That's what I'm doing:
client := &http.Client{} req, err := http.NewRequest("POST", "http://api.russia.travel/", strings.NewReader(xmlbody)) req.SetBasicAuth("view", "view") resp, err := client.Do(req) if err != nil { fmt.Println("Error! %s", err) } And I get error 400: invalid query syntax. In the xml-body of the request, I'm sure sending it to the sandbox gives the desired result. In this connection, I think that the case in the login hash, most likely, I am not there (wrong) using them?
I would be very grateful for the help or at least a hint in which direction to move.