I'm trying to use a GET request using clj-http.client from ShipStation and getting a 401 error,
they have lots of examples of different languages of how to do this. Javascript seems easy:
var myHeaders = new Headers();
myHeaders.append("Host", "ssapi.shipstation.com");
myHeaders.append("Authorization", "username:password");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://ssapi.shipstation.com/orders/orderId", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Here is my clojure client/get code which works fine without headers and using {:async? true} from other websites such as jsonplaceholder:
(client/get "https://ssapi.shipstation.com/shipments?shipDateStart=2023-01-05&shipDateEnd=2023-01-05"
{:header { "Host" "ssapi.shipstation.com" "Authorization" "username:password"}}
(fn [response] (println "hello" (get response :body)))
(fn [exception] (println "exception message is: " (.getMessage exception))))
can someone help me with the format of this GET request?
As per the docs it looks like you want:
That presumes that Basic-Auth is in play which is what the endpoint and api docs suggest but I'm not a shistation user