Last active
August 27, 2015 07:03
-
-
Save wna-se/228fe2708c9a3e6c88f4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| cat <<EOT | curl -X POST -H "Content-Type: application/json" http://dflow/api/jobs -d @- | |
| { | |
| "api_key": "test_key", | |
| "job": | |
| { | |
| "copyright": "false", | |
| "treenode_id": "3", | |
| "name": "Test job name", | |
| "object_info": "", | |
| "comment": "", | |
| "catalog_id": "1234", | |
| "source": "libris", | |
| "source_label": "Libris", | |
| "title": "Water and water pollution handbook.", | |
| "metadata": { | |
| "type_of_record": "am" | |
| }, | |
| "is_periodical": "false", | |
| "xml": "<xml />" | |
| } | |
| } | |
| EOT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Några saker:
Lägg med content-type likt
curl -X POST -H "Content-Type: application/json" http://localhost:3002/api/jobsJSON dokumentet måste vara korrekt formaterat, du har ett komma för mycket på rad 10, och ett för lite på rad 11.
XML datan måste vara giltig xml, likt:
"xml": "<xml />"api_key skickas inom JSON och inte som header, så den kan du ta bort.
I övrigt fungerar ovanstående!