Guerrilla
Guerrilla

Reputation: 14886

API ignoring my input on POST

I am sending this body via API POST to extractor I created with app.

{"input":{"website/url":"http://www.targetsite.com/"}}

No matter what URL I put in, it always returns me the results from the same page (I think it must be the one I trained it on). I can put any string in there and it just totally ignores it.

GET works fine but I would much rather use POST.

Anyone know why this isn't working?

Upvotes: 4

Views: 175

Answers (1)

Ian
Ian

Reputation: 379

this should work, here is a worked example

curl -b authcookie -XPOST 'https://api.import.io/store/data/f53e3905-c5d0-457a-befd-d13a3a421bcf/_query' -d '
{
    "input": {
        "webpage/url": "http://www.ikea.com/us/en/search/?query=chair"
    }
}
'

compared to:-

curl -b authcookie -XPOST 'https://api.import.io/store/data/f53e3905-c5d0-457a-befd-d13a3a421bcf/_query' -d '
{
    "input": {
        "webpage/url": "http://www.ikea.com/us/en/search/?query=light"
    }
}
'

table versus light results. If you look in the json of the response it should tell you the url that the results are returned from:-

 "pageUrl": "http://www.ikea.com/us/en/search/?query=light",

You can also try out this yourself on our api docs:-

http://api.docs.import.io/#!/Query_Methods/queryPost

Upvotes: 6

Related Questions