`Why 404 error?
T
T
TheSnegok2021-08-04 23:12:32
React
TheSnegok, 2021-08-04 23:12:32

Why 404 error?

Axios request:

return Axios.get({
            headers: { 'Content-Type': "text/html; charset=utf-8" },
            url: `https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json&json=?`
        }).then((response) => response.data);

Output and error code:
610af48bc6bee010351635.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
SagePtr, 2021-08-04
@SagePtr

Most likely, the function expects a string as input, and you feed an object there.
Try like this:

return Axios({
            method: 'get',
            headers: { 'Content-Type': "text/html; charset=utf-8" },
            url: `https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json&json=?`
        }).then((response) => response.data);

V
Vit, 2014-04-02
@Namelles_One

Method Chaining

P
Petr Sh, 2018-03-25
@kester

fluent interface

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question