Category : postman

I want to post an image with some data like this postman image: Inside body: And inside header: And I write some code for uploading image like postman but I got this error: okhttp3.internal.http2.ConnectionShutdownException And here is my code as below: File globalFileName; RequestBody requestBody1 = RequestBody.create(MediaType.parse("*/*"), globalFileName); MultipartBody.Part fileToUpload1 = MultipartBody.Part.createFormData("uploadFile", globalFileName.getName(), requestBody1); ApiConfig ..

Read more

I’m trying to pass datas to my back-end Node js server with my react native app. And for that i’m using axios. onTrigger = () => { const params = JSON.stringify({ "username": "Name", "password": "Pass", }); axios.post(‘http://192.168.1.36:8080/api/signin’,params) .then(function (response) { this.props.navigation.navigate(‘Principal’) }) .catch(function (error) { console.log(error); }); } But it’s not doing nothing. My server ..

Read more

I have a simple GET url request to Google https://www.google.com/search?q=24%2F7+Becky+G+lyrics While using postman it gives a different response but when I request it through my code using volley its giving me a different response. Im even adding headers tried adding cookie but still response is not same as postman response. StringRequest stringRequest = new StringRequest(Request.Method.GET, ..

Read more

I have been trying to replicate the below request with Retrofit2 So far I have tried the following Retrofit requests 1. @Multipart @POST public Call<I3ClaimsResponse> postDocument(@Url String url, @Header("Authorization") String token, @Header("Content-Type") String contentType, @Part("files") RequestBody file); RequestBody body = RequestBody.create(pdfFile, MediaType.parse("application/pdf")); @Multipart @POST public Call<I3ClaimsResponse> postDocument(@Url String url, @Header("Authorization") String token, @Header("Content-Type") String contentType, ..

Read more

I have Wrote an API via jwt-auth package in laravel. When I use postman I can get User Data but in android I cant do this an returns null. This is my Backend code: public function __construct() { $this->middleware(‘auth:api’, [‘except’ => [‘login’, ‘register’]]); } public function user() { return response()->json(auth()->user()); } public function login(Request $request) ..

Read more