Closed hethcox closed 5 years ago
This is because the library fails to parse the error message that returned from the service to json. It expects everything, including the errors to be JSON. I'm currently working on fixing this in a fork as this project is dead https://github.com/OpenUnirest/unirest-java/issues/10
Hello, this should be resolved or addressed in Unirest 2. Please see the upgrade guide for important changes.
I was building out my REST call to mailgun and I used "apiKey" instead of "api" (started with a different example) thus: .basicAuth("api", apiKey) Instead of complaining about a missing key I got: Caused by: org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1]
It took a while to sort-out what was wrong. I'm posting this in hopes of saving future headaches.