DEV Community

Discussion on: POST request in redux-saga not working

Collapse
 
saiavinashiitr profile image
Sai Avinash Duddupudi • Edited

Update :- The 400 Bad request has gone away after I added "Content-Type": "application/x-www-form-urlencoded" in the headers and changed the body type accordingly

Example :-

fetch("api/xxx", {
    body: "email=test@example.com&password=pw",
    headers: {
        "Content-Type": "application/x-www-form-urlencoded",
    },
    method: "post",
}
Enter fullscreen mode Exit fullscreen mode