Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

POST Data is not passing. #67

Closed
tonraj opened this issue Nov 24, 2020 · 6 comments
Closed

POST Data is not passing. #67

tonraj opened this issue Nov 24, 2020 · 6 comments

Comments

@tonraj
Copy link

tonraj commented Nov 24, 2020

Desktop (please complete the following information):

  • OS: Windows
  • Browser Chrome
  • Version 88.0.4324.11 (Official Build) dev (64-bit)

Trying to use in Ionic Vue.

Http.request({
method: 'POST',
url: ApiHost + '/api/v1/seller/login',
data: {phone : this.phone, password: this.password},
headers: {
'X-Fake-Header': 'Max was here'
},
params: {
size: 'XL'
}
}).then((res)=>{
if(res.status == 200){
Storage.set({ key: 'token', value: res.data.token }).then((res)=>{
this.route.push('/register/step/2');
});
}else{
this.logging = false;
}
});

@luisgonptl
Copy link

Check that you are adding the "add(Http.class);" in your android MainActivity.

@tonraj
Copy link
Author

tonraj commented Dec 6, 2020

Check that you are adding the "add(Http.class);" in your android MainActivity.

I did.

@luisgonptl
Copy link

Try remove params, and move the size property to data.
POST -> data goes in data
GET -> data goes in params

@tonraj
Copy link
Author

tonraj commented Dec 13, 2020

POST

Yeah I did but nothing goes inside DATA.

I moved to AXIOS closing the issue.

@tonraj tonraj closed this as completed Dec 13, 2020
@KimGnab
Copy link

KimGnab commented Jan 6, 2021

POST

Yeah I did but nothing goes inside DATA.

I moved to AXIOS closing the issue.

How did you solve the cors error in AXIOS?

@butaminas
Copy link

This seems to be an old issue but I have the exact same problem.
I only set data (my post request parameters), headers and url in the config that I pass to Http.post(config).

For some reason, the post parameters are never passed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants