Skip to content

Instantly share code, notes, and snippets.

@gaubert
Created October 21, 2010 14:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaubert/638592 to your computer and use it in GitHub Desktop.
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
#!/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"
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