Created
September 9, 2011 06:48
-
-
Save tomayac/1205635 to your computer and use it in GitHub Desktop.
POST to DBpedia Spotlight
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is what I try: | |
curl -i -X POST -d "text=dbpedia+spotlight+is+neat.&confidence=0.2&support=10" -H "Accept:application/json" -H "Content-Type:application/x-www-form-urlencoded" http://spotlight.dbpedia.org/rest/annotate | |
# This is what I get: | |
HTTP/1.1 415 Unsupported Media Type | |
Date: Fri, 09 Sep 2011 06:46:25 GMT | |
Transfer-Encoding: chunked | |
Content-Type: text/plain | |
# What is the correct "Content-Type" header if not "application/x-www-form-urlencoded"? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated example:
Set
-d
for POST and form encoding (-d
uses theapplication/x-www-form-urlencoded
mime-type). More here: https://curl.se/docs/manual.htmlInspect the output in stderr to check that it's indeed using POST and setting the right Content-type and Accept headers.
Check that you got a response from the API: