Consensys / Mahuta

IPFS Storage service with search capability
Apache License 2.0
239 stars 49 forks source link

Mistakes in Wiki (API Documentation) #26

Closed SohamLawar closed 6 years ago

SohamLawar commented 6 years ago

-[Persistent / JSON] Store content --Sample Request:

 $ curl -X POST \
    'http://localhost:8040/ipfs-store/json/store' \
    -H 'Content-Type: application/json' \
    -d '{
      "field1": "val1",
      "field2": 10,
      "field3": {
          "test": true
      }
    }

' is missing in the above query -[Query] Get content

curl \
    'http://localhost:8040/ipfs-store/fetch/QmWPCRv8jBfr9sDjKuB5sxpVzXhMycZzwqxifrZZdQ6K9o' \
    -o hello_doc.pdf 

/query is missing before the hash so the corrected query is -

curl \
    'http://localhost:8040/ipfs-store/query/fetch/QmWPCRv8jBfr9sDjKuB5sxpVzXhMycZzwqxifrZZdQ6K9o'\
    -o hello_doc.pdf 

-Sample Request:

curl -X POST \
    'http://localhost:8040/ipfs-store/search?index=documents' \
    -H 'content-type: application/json' \  
    -d '{"query":[{"name":"title","operation":"contains","value":"Hello"},{"name":"author","operation":"equals","value":"Gregoire Jeanmart"},{"name":"votes","operation":"lt","value":"5"}]}'

/query is missing, the corrected query is

curl -X POST \
    'http://localhost:8040/ipfs-store/query/search?index=documents' \
    -H 'content-type: application/json' \  
    -d '{"query":[{"name":"title","operation":"contains","value":"Hello"},{"name":"author","operation":"equals","value":"Gregoire Jeanmart"},{"name":"votes","operation":"lt","value":"5"}]}'
gjeanmart commented 6 years ago

Thanks for your feedback. I fixed the wiki!