Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7199

OKHTTP 3 MediaType as "application/x-www-form-urlencoded" crash issue

$
0
0

I was trying to implement postman's working as following for android app:enter image description here

Here is my java codes:

    MediaType CONTENT_TYPE = MediaType.parse("application/x-www-form-urlencoded");    RequestBody requestBody = new MultipartBody.Builder()            .setType(CONTENT_TYPE)            .addFormDataPart("phoneNumber", phone)            .addFormDataPart("serviceType", type)            .addFormDataPart("stripeToken", token)            .addFormDataPart("serviceCost", String.valueOf(amount))            .build();    final Request request = new Request.Builder()            .url(Const.URL_HEROKU_BASE+"payment/charge")            .post(requestBody)            .build();

It makes crash ...enter image description here


Viewing all articles
Browse latest Browse all 7199

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>