Request request = new Request.Builder()
.url("http://example.com")
.post(RequestBody.create("foo",MediaType.get("text/plain")))
.build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
//e.printStackTrace();
RequestBody b = call.request().body();
String t= b.toString(); ??? <-How would I get the original message?
}
@Override
public void onResponse(Call call, Response response) throws IOException {
//do something
}
});
On failure I am trying to save the original message that I sent.
I looked through the functions and I don't seem to be able to figure out how to get the original message I sent in the callback. Is there a way to get the message back?
