manet icon indicating copy to clipboard operation
manet copied to clipboard

error after AJAX call

Open l2ysho opened this issue 8 years ago • 1 comments

I have problem with AJAX calls on manet running on local host. With curl or browser is everything ok.

This is my AJAX call:

 $.ajax({
        method: 'GET',
        url: 'http://localhost:8891/?url=github.com',
        contentType: 'application/json',
        dataType: 'jsonp',
        crossDomain: true,
    }).done(function (res) {
            console.log(res);
            var pdf = res;
    }).fail(function (error) {
        console.log(error.error);
    }) ;

When perform call, i get this error in console:

2017-02-02T11:44:24.727Z - info: Capture site screenshot: "github.com"

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND jquery220038298134896883895_1486035861301 jquery220038298134896883895_1486035861301:80
    at errnoException (dns.js:26:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)

this is error from browser:

 Uncaught  SyntaxError: Unexpected token : ?url=github.com&callback=jQuery2200382…_1486035861301&_=1486035861302:1

l2ysho avatar Feb 02 '17 11:02 l2ysho

@l2ysho I think, you need try to use "POST" method with "application/json" parameter: https://github.com/vbauer/manet#rest-api

vbauer avatar Feb 12 '17 05:02 vbauer