dimanche 26 juillet 2020

Request failed with status code 405 React Native Laravel

I am having Request failed with status code 405 error when submitting the post request from React Native and using Laravel 7 in the backend.

const data = {
...
}

const headers = {
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Allow-Method": "POST",
    "Content-Type": "application/json",
}

axios.post(API_URL, data, headers).then((response) => {
    consoleLog("token", response.data)
    if (response.data) {
        this.setState({
            bkashURL: API_URL + response.data,
            loading: false,
        })
    }
})

Laravel Route:

Route::post('/', 'PaymentController@processInput');

enter image description here

Please help.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire