Fuel.post returns status -1
jazzdev opened this issue · comments
JD Brennan commented
val (request, response, result) = Fuel.post("/envelopes")
.jsonBody(envelopeDefinition)
.response()
println("R: ${response.statusCode} ${response.responseMessage}")
output:
R: -1
I suspect it's some kind of network problem (DNS or firewall). Can I get more details on the error from Fuel so I can debug it?
JD Brennan commented
The problem was SSL cert validation failed. I just switched to HTTP.
The fix for issue #782 should work also, but I didn't try it.
JD Brennan commented
The real answer to my issue (how to get details on the error message) is:
result.onError {
println("Error: ${it.message}")
}