Created
October 21, 2010 14:39
-
-
Save gaubert/638592 to your computer and use it in GitHub Desktop.
quick and dirty script for posting a file content with curl (second file also changes the HTTP Header
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
#!/bin/bash | |
if [ ! -e "$1" ]; then | |
echo "Error: Need a file to post" | |
echo "Usage: curl_post file_to_post.file" | |
exit 1 | |
fi | |
if [ -c "$1" ] | |
then | |
echo "Error: Need a file to post" | |
echo "Usage: curl_post file_to_post.file" | |
exit 1 | |
fi | |
#read file | |
value=`cat $1` | |
# json echo service | |
curl "http://vnavigator.eumetsat.int/soapServices/services/CSWDiscovery" -i -X POST -d"$value" |
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
curl "http://127.0.0.1:5000/channels" -i -H "Content-type: application/json" -X POST -d"$value" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment