SHARE
TWEET

Untitled

a guest Dec 11th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. OkHttpClient client = new OkHttpClient();
  2.  
  3. MediaType mediaType = MediaType.parse("application/json");
  4. RequestBody body = RequestBody.create(mediaType, "{\"name\": \"Pidor Pidorasivich\",\n \"login\": \"myLogin\"}");
  5. Request request = new Request.Builder()
  6.   .url("http://localhost:3000/api/auth/sign-up")
  7.   .post(body)
  8.   .addHeader("authorization", "Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImQ1OThkYjVjZjE1ZWNhOTI0OWJhZTUzMDYzOWVkYzUzNmMzYzViYjUiLCJ0eXAiOiJKV1QifQ.eyJuYW1lIjoiQWxleGFuZGVyIFBoYXRvTSIsInBpY3R1cmUiOiJodHRwczovL2xoNC5nb29nbGV1c2VyY29udGVudC5jb20vLVh4UE9fZU9IdTlzL0FBQUFBQUFBQUFJL0FBQUFBQUFBQUFBL0FDSGkzcmNScVBfT0tjbUp5TjBZNjVzb3ZyVWJoU05Mdncvczk2LWMvcGhvdG8uanBnIiwiaXNzIjoiaHR0cHM6Ly9zZWN1cmV0b2tlbi5nb29nbGUuY29tL2hvbGRteWJlZXIiLCJhdWQiOiJob2xkbXliZWVyIiwiYXV0aF90aW1lIjoxNTc1OTkyMDY5LCJ1c2VyX2lkIjoiN1QyV1VsTHNHeFM5VkthdkhCY2FyYXRTbkpFMyIsInN1YiI6IjdUMldVbExzR3hTOVZLYXZIQmNhcmF0U25KRTMiLCJpYXQiOjE1NzU5OTIwNzEsImV4cCI6MTU3NTk5NTY3MSwiZW1haWwiOiJwaGF0b20uZGV2ZWxvcGVyQGdtYWlsLmNvbSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJmaXJlYmFzZSI6eyJpZGVudGl0aWVzIjp7Imdvb2dsZS5jb20iOlsiMTEwNTY5MDU4ODUzMzEzMjg1NzI4Il0sImVtYWlsIjpbInBoYXRvbS5kZXZlbG9wZXJAZ21haWwuY29tIl19LCJzaWduX2luX3Byb3ZpZGVyIjoiZ29vZ2xlLmNvbSJ9fQ.hwLazjvtIyXHDYm9xLs-z323TePiWF_Vt6MTNTH6xrdZF5GoVGs9SvKBXf-kf_OXXUnnZkqe40ACgjX55Fup6Xk_AjjWEH_nuD2-grci9vsgrZacIKIxso0nbKFcVUKEVHJshA7sPNvg4NTYWTdvZKcHbWLVvWC-wrn1-8h8IEoGO--ej974z0sbG4_vD_jBpdDW8LjdQQOht6VqZ2HoBLcGm0t3ttZVwSmyOJKnDhF6t8-Qj2a2RtsTJ5kplxMR57kvFr_pZpNjZv6Z0pLH23s9Q6XPA12Dh3CV68gpWYQccVVcJeO2XPQVo2VvIDmjZde5rMhEuHMUmH0z2IdKbQ")
  9.   .addHeader("Content-Type", "application/json")
  10.   .addHeader("Cache-Control", "no-cache")
  11.   .addHeader("Postman-Token", "040a3254-babb-41dc-8b45-56ca58f19d1a")
  12.   .build();
  13.  
  14. Response response = client.newCall(request).execute();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top