'Why browsers send get request instead of post request in my React project that uses Redux?
I have a dispatch in one of my components that calls by form submission:
const handleSubmit = (values) => {
dispatch(resetPassActionCreator(values.email));
};
and this is resetPassActionCreator function:
export const resetPassActionCreator = username => dispatch => {
const url = PASSWORD_RESET_GET_EMAIL;
dispatch(
apiCallBegan({
url,
method: "POST",
onStart: passwordResetSlice.actions.resetPassword.type,
onSuccess: passwordResetSlice.actions.resetPasswordSuccess.type,
onError: passwordResetSlice.actions.resetPasswordFail.type,
data: {
username,
},
})
);
};
and I check the url and it does not have '/' at the end.
can anyone tell me why the browser sends get request instead of post?
Solution 1:[1]
This is not a problem with the browser.
Probably you are using apiCallBegan in the wrong way )
or its implementation does not support POST requests.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Krystian Sztadhaus |
