• mueeznarejo

    (@mueeznarejo)


    Hi, Thanks for this amazing plugin, My issue is all the request works well with Postman but in the browser(localhost:3000) it returns Error: Request failed with status code 400

    I have tried with JS fetch and Axios but both of them return same error

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author dominic_ks

    (@dominic_ks)

    Hey @mueeznarejo,

    Thanks for using the plugin and reporting your issue.

    Off the bat, the fact that it works in Postman but not in the browser makes me think that it’s related to how you’re making the call in the browser, can you give me some more info on that?

    i.e. are you making the call from a JavaScript app / framework of some kind? Are you able to check the payload your are sending in the developer tools / console of your browser?

    Also, is there any other message that comes back with the 400 code? All of the errors produced by the plugin should come with an error message.

    Cheers,
    Dominic,

    • This reply was modified 3 years ago by dominic_ks.
    Thread Starter mueeznarejo

    (@mueeznarejo)

    @dominic_ks

    Yes, I am using React.js with Next.js as a front-end

    POST https://test.hallarazad.com/wp-json/bdpwr/v1/reset-password         400
    Error: Request failed with status code 400
        at createError (createError.js?770c:16:1)
        at settle (settle.js?8768:17:1)
        at XMLHttpRequest.onloadend (xhr.js?1a5c:66:1)
    
    Plugin Author dominic_ks

    (@dominic_ks)

    @mueeznarejo

    Thanks for that, though I don’t know if I can do much to help here without details of the request, I recommend checking the network tabs of the developer console in your browser and looking at the request payload. i.e. for this call checking that you are providing the email parameter and it’s properly formatted JSON.

    And again, in the network tab, the actual response from your server, it should look something like this:

    {
        "code": "bad_email",
        "message": "No user found with this email address.",
        "data": {
            "status": 500
        }
    }

    Cheers,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Return “Error: Request failed with status code 400” in Browser’ is closed to new replies.