Haystack: How can I use "File Upload" in rest api?

Created on 2 Jul 2020  路  3Comments  路  Source: deepset-ai/haystack

To author:
I have tried your new version of RestAPI. When I upload the text file, it always respond "null". Other than that, I just saw a new file uploaded to Elasticsearch? Is that correct?
2

Jonathan Sung

api question

Most helpful comment

Just to say it works now ! tks for the fix

All 3 comments

Hello,
I am having some trouble as well on this "file-upload" endpoint. I have a different output though :
Screenshot 2020-07-02 at 15 48 03

I am using the latest version of the master branch. The only change I did is in the docker-compose.yml file, using the "raw" elasticsearch image as such:
yml elasticsearch: image: "elasticsearch:7.6.1" ports: - 9200:9200 environment: - discovery.type=single-node

Note: it works fin while going through the tutorials with ipython.
Note 2 : I use a text from thw GOT corpus called "blood of my blood" => the text should not be the problem I believe

Hi @laifuchicago and @guillim,

A response message is now added when a file upload is successful(#195).

The file upload uses a HTTP POST with multipart/form-data enctype. For that, the python-multipart dependency was missing that might have caused HTTP 400 {"detail":"There was an error parsing the body"} error. The dependency is now updated in the requirements.txt by #195.

Just to say it works now ! tks for the fix

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mongoose54 picture mongoose54  路  7Comments

antoniolanza1996 picture antoniolanza1996  路  4Comments

zshnhaque picture zshnhaque  路  3Comments

tholor picture tholor  路  6Comments

anirbansaha96 picture anirbansaha96  路  5Comments