magwyz / pastec

Image recognition open source index and search engine
http://pastec.io
GNU Lesser General Public License v3.0
620 stars 175 forks source link

MISFORMATTED_REQUEST #45

Closed saintjab closed 7 years ago

saintjab commented 7 years ago

Hi, I am trying to use the API to make POST request but I am not able to get required result. I only get this the error "Misformatted_Request". Here is my request and response:

curl --header "AuthKey: xxxxxxxxxx" -X POST -F image="@c:/home/bag.jpg" https://api.pastec.io/indexes/xxxxxxxxxx/index/searcher

{"type":"MISFORMATTED_REQUEST"}

The POST is the only problem I am facing as I can add or remove any image from my index. Please help

chrishein commented 7 years ago

Try using

--data-binary @c:/home/bag.jpg

instead of

-F image="@c:/home/bag.jpg" 
saintjab commented 7 years ago

I had tried both but it still gives the same error. And even tried with the path in single and double quotes but the results are same

curl --header "AuthKey: xxxxxxxxxxxxx" -X POST --data-binary @c:/home/gombolola1.jpg https://api.pastec.io/indexes/ xxxxxxxxxxxxx/index/searcher {"type":"MISFORMATTED_REQUEST"}

curl --header "AuthKey: xxxxxxxxxxxxx" -X POST --data-binary '@c:/home/gombolola1.jpg' https://api.pastec.io/indexes/xxxxxxxxxxxxx/index/searcher {"type":"MISFORMATTED_REQUEST"}

curl --header "AuthKey:xxxxxxxxxxxxx" -X POST --data-binary "@c:/home/gombolola1.jpg" https://api.pastec.io/indexes/xxxxxxxxxxxxx/index/searcher {"type":"MISFORMATTED_REQUEST"}

curl --header "AuthKey: xxxxxxxxxxxxx" -X POST --data-binary "c:/home/gombolola1.jpg" https://api.pastec.io/indexes/xxxxxxxxxxxxx/index/searcher {"type":"MISFORMATTED_REQUEST"}

curl --header "AuthKey:xxxxxxxxxxxxx" -X POST --data-binary 'c:/home/gombolola1.jpg' https://api.pastec.io/indexes/xxxxxxxxxxxxx/index/searcher {"type":"MISFORMATTED_REQUEST"}

and I am 100% sure of my AuthKey and API key as the result indicates its not related to those

chrishein commented 7 years ago

Well, I can't help you any further, as you're referring to https://api.pastec.io, which is private hosted version of a service. I don't know what version of this project's source code is deployed there.

For what I can see in the code, there is no way the server can return a MISFORMATTED_REQUEST while doing a post to the search endpoint, other than hitting an internal server error.

You should try reaching http://pastec.io/ support.

saintjab commented 7 years ago

Thanks @chrishein for the help anyways. I tried contacting their support but nothing yet so I am gonna wait for them. In the meantime, can you give me some pointers on how I can self host this library. I would love to test it. Thanks

chrishein commented 7 years ago

You can run it on your own server by following the docs at http://pastec.io/doc/oss/#setup We should probably not follow this conversation on this threads as it is not related to this project or specific issue. Regards