I want to build a simple Response class for my nestetd and dynamic Json Response. I recently build my Response class with boolean error, String message and a List<User> user, but if i try to work with the List (for example i want to put out the size of the list or get a user ..
Category : postman
I’m having a problem with Retrofit. When I make a call to my REST API, every time the response.body() is not successfull and null I tried to make the same call with Postman and the body contains the correct answer. The JSON response Body: { "error": false, "message": "API-Request successful", "users": { "0": { "userID": ..
i want to build a GPS Android App with Rest APIs requests using Retrofit. However, I have a problem with a requets. All of my other requests work fine. I hope someone can help me … Source: Android..
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 ..
I’m new in Android and programming as well. I would like to build an Android app with user login and User Location tracer. What’s the easiest way to convert a Json String to Java Class? My Json String: Source: Android..
I am using retrofit to send a request to server and get data as in response, but the issue is that some time i get an error of 404 from server. I am hitting a server using Http protocol and when error come it response in https. when the error occurs after that every requests ..
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 ..
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, ..

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, ..
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) ..
Recent Comments