0

I am trying to get some response from wizzair API (no official docs, I came across with XHR in dev tools).

So far I established that there is url https://be.wizzair.com/7.10.1/Api/search/search

and an object payload that is passed through POST method to fetch the data back.

How could I pass the object to URL with POST?

This is my try that gives 404.

$.ajax({
    method:     "POST",
    type:       "json",
    url:        url+payload,
    success:    function (data) {
                    console.log(data);
                }
    ,
    error:      function (xhr, ajaxOptions, thrownError) {

                    alert(xhr.status);
                    alert(thrownError);
    },
});

The other problem is No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 404.

see image of dev tools

J. Doe
  • 37
  • 5
  • You're not going to be able to do it from browser code. You'd have to write something outside the browser to make the HTTP requests. – Pointy Apr 05 '18 at 20:10
  • 1
    Try this: https://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit – Aleksey Dr. Apr 05 '18 at 22:13

0 Answers0