« lego vacuum, patent 6048249 : Plastic building block toy cleanup vacuum attachment | Main | How to get a copy of the Google Transit data set for your bus system; part 1, AATA »

December 30, 2008

stuck on a postcard / postful / curl problem

FIXED, see the bottom.  12/31

rather than give up in total frustration, here's what I am trying to implement, using "curl" to drive the system.  This is from the "postful" API docs.

1. Upload the document.

To uploading a document, submit a POST to:

http://www.postful.com/service/upload

Be sure to include the Content-Type and Content-Length headers and the document itself as the body of the request.

POST /upload HTTP/1.0
Content-Type: application/octet-stream
Content-Length: 301456

... file content here ...

If the upload is successful, you will receive a response like the following:

<?xml version="1.0" encoding="UTF-8"?>
<upload>
<id>290797321.waltershandy.2</id>
</upload>

What is critical in this response is the id assigned by the server to your document, in this example 290797321.waltershandy.2. You will use that id to reference the document in the next step.

I think it should work with

curl -v --user edward.vielmeti@gmail.com:t0ps3kr3t  --data-binary "upload=@m-28-shield.png" http://postful.com/service/upload

but, it doesn't.  ideas?  mac os if it matters, the

% curl --version
curl 7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
Protocols: tftp ftp telnet dict ldap http file https ftps
Features: GSS-Negotiate IPv6 Largefile NTLM SSL libz 

update: typo fixed

update2: working now!  command line is

curl -k -v --user edward.vielmetti@gmail.com:s4x4s54  --data-binary "@m-28-shield.png" https://postful.com/service/upload

note three things: "-k" option; https, not http:; spell the user name right (duh).

next task: get the address side formatted right.

Comments

Don't know curl very well, but does it automatically create the Authorization header that postful wants?

http://www.postful.com/developer/guide#authorization

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

About Edward Vielmetti

My Photo

Categories

mybloglog


Subscribe to Vacuum

  • Subscribe with Bloglines

    See also my other blog, Superpatron, for library patrons and libraries.

Blog powered by TypePad
Member since 08/2003