I have task to check AWS pricing, it's a public json file. there is no auth needed.
I use Tapir Sttp library
val request: Request[Either[String, String], Any] = basicRequest
.header(HeaderNames.Accept, MediaType.ApplicationOctetStream.toString())
.get(uri"https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/index.json")
val response = request.send(sttpBackend)
val res = Await.result(response, 30.seconds)
above is my simple get call. But I got error Caused by: java.io.UnsupportedEncodingException: Unsupported encoding
I can download the file from browers, get the json from Postman. Anybody know how to download file by sttp client Thanks
try to download json file from amazon pricing endpoint