0

Hello I need help with http post request to my server and get response with authentication.

Look on the screens on 1 I use insomnia REST API application. Using this app I got success response with premium days and id.

In second image I got response just from my nativescript vue.js app where I got false response.

There is something wrong with my code. please tell me what.

enter image description here

enter image description here

1 Answer 1

1

You are sending a JSON object in your request body from {N} app, on the other hand you are using FormData with your REST client for testing.

You must either change your API to support JSON data on request body which is generally the standard way. In case if you can't do that, then you must use the nativescript-background-http plugin to send FormData. It will be something like,

var params = [
   { name: "username", value: "test" },
   { name: "password", value: "test123" },
   { name: "uuid", value: "xxxx" }
];
var task = session.multipartUpload(params, request);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.