monarch-initiative / biolink-api

API for linked biological knowledge
https://api.monarchinitiative.org/api/
BSD 3-Clause "New" or "Revised" License
64 stars 25 forks source link

Query with content-type : application/json returns 400 status code #328

Open lpalbou opened 4 years ago

lpalbou commented 4 years ago

Sending this query:

curl 'http://api.geneontology.org/api/ontology/ribbon/?subset=goslim_agr&subject=ZFIN:ZDB-GENE-980526-166&subject=HGNC:10848&subject=MGI:98297&subject=RGD:3673&subject=FB:FBgn0004644&subject=WB:WBGene00001700&subject=WB:WBGene00001691&subject=WB:WBGene00004264&subject=WB:WBGene00006952&exclude_PB=true&exclude_IBA=true' -H 'Content-Type: application/json' -I

Will return a 400 due to the content-type

kshefchek commented 4 years ago

What is the use case for passing 'application/json' for url encoded parameters? The content type header should be application/x-www-form-urlencoded.

I suspect if you set up a POST request in the api code and passed JSON data this would all work, eg

curl -X POST "https://api.geneontology.org/api/some/function" -H  "accept: application/json" -H  "Content-Type: application/json" -d "{ some json }"