better curl examples

This commit is contained in:
Brad Fitzpatrick 2010-11-04 22:01:01 -07:00
parent cecb688f47
commit 8c78fe79ea
1 changed files with 9 additions and 16 deletions

View File

@ -1,14 +1,12 @@
#!/bin/bash #!/bin/bash
# Example client accesses to blob server using curl. # Example client accesses to blob server using curl.
#
#
BSHOST=localhost:8080
BSPASS=foo
# Preupload -- 200 response # Preupload -- 200 response
curl -v \ curl -u user:$BSPASS -d camliversion=1 http://$BSHOST/camli/preupload
-d camliversion=1 \
http://localhost:8080/camli/preupload
# Upload -- 200 response # Upload -- 200 response
curl -v -L \ curl -v -L \
@ -21,24 +19,19 @@ curl -v -L \
#<the url returned by preupload> #<the url returned by preupload>
# Get present -- the blob # Get present -- the blob
curl -v http://localhost:8080/camli/\ curl -u user:$BSPASS -v http://$BSHOST/camli/sha1-126249fd8c18cbb5312a5705746a2af87fba9538
sha1-126249fd8c18cbb5312a5705746a2af87fba9538
# Get missing -- 404 # Get missing -- 404
curl -v http://localhost:8080/camli/\ curl -u user:$BSPASS -v http://$BSHOST/camli/sha1-22a7fdd575f4c3e7caa3a55cc83db8b8a6714f0f
sha1-22a7fdd575f4c3e7caa3a55cc83db8b8a6714f0f
# Check present -- 200 with only headers # Check present -- 200 with only headers
curl -I http://localhost:8080/camli/\ curl -u user:$BSPASS -I http://$BSHOST/camli/sha1-126249fd8c18cbb5312a5705746a2af87fba9538
sha1-126249fd8c18cbb5312a5705746a2af87fba9538
# Check missing -- 404 with empty list response # Check missing -- 404 with empty list response
curl -I http://localhost:8080/camli/\ curl -I http://$BSHOST/camli/sha1-22a7fdd575f4c3e7caa3a55cc83db8b8a6714f0f
sha1-22a7fdd575f4c3e7caa3a55cc83db8b8a6714f0f
# List -- 200 with list of blobs (just one) # List -- 200 with list of blobs (just one)
curl -v http://localhost:8080/camli/enumerate-blobs?limit=1 curl -v -u user:$BSPASS http://$BSHOST/camli/enumerate-blobs?limit=1
# List offset -- 200 with list of no blobs # List offset -- 200 with list of no blobs
curl -v http://localhost:8080/camli/enumerate-blobs?after=\ curl -v -u user:$BSPASS http://$BSHOST/camli/enumerate-blobs?after=sha1-126249fd8c18cbb5312a5705746a2af87fba9538
sha1-126249fd8c18cbb5312a5705746a2af87fba9538