W
W
WalkersRei2019-03-11 05:32:58
JavaScript
WalkersRei, 2019-03-11 05:32:58

404 in GET request how to fix?

On the client side, a GET request is made in JS, the file itself is generated in PHP. When you click on the link
IXinidadQ6axafg1ofPf-Q.pngMusr-R-CT7ieOe_0KXDbxw.png
Here is the code itself, data.msg should be there, the file itself is generated:

$.get(
                      "https://api.demo.com/voice.php",
                      {
                        text: data.msg
                      },
                    );
                    var audio = new Audio('https://demo.com/' + data.msg + '.mp3');
                    audio.play();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Savrasov, 2019-03-11
@WalkersRei

Most likely you are not giving the correct headers when generating the file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question