Closed nbastoWM closed 6 years ago
Answering my question:
export function postLogin(username, password) {
console.log('>>>>> postLogin');
let url = config.authentication_url;
return {
type: POST_LOGIN,
payload: {
request: {
method: 'post',
url: url,
params: {
username: username,
password: password,
device: Platform.OS === 'ios' ? 'ios' : 'android',
}
}
}
};
}```
In case anyone has the same question, the answer above is false. params
should be data
, otherwise it will get sent as query parameters.
return {
type: POST_LOGIN,
payload: {
request: {
method: 'post',
url: url,
data: {
username: username,
password: password,
device: Platform.OS === 'ios' ? 'ios' : 'android',
}
}
}
}
@robinvw1 What about method is 'GET'?
I want to use this middleware in a login action but I can't find out how to make a post request.