couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Weber <scotty2...@sbcglobal.net>
Subject Multiple "follows" attachments not working.
Date Wed, 29 May 2013 20:35:08 GMT
Hello,
I am trying to add multiple attachments during creation of a document.

Specifically, I am using this information:
http://wiki.apache.org/couchdb/HTTP_Document_API#Multiple_Attachments

The problem is, it is not working.  And I am not getting a response at all.  And 
the Erlang user window isn't showing anything.

However, I can put regular documents in.  All day long.  I get a good response, 
and the Erlang user windows shows the 'PUT' request with a happy ending (so to 
speak).

I've gone as far as to strip my code down to where it create something that 
looks almost the same as the example.  And I even write it to a file just before 
sending it, so I can see it.  It is pasted below.

But no reply.  Total silence on the socket and in the Erlang window.

Any advice is appreciated.  The document is purely a carrier for the 
attachments, and I wish to avoid putting all the attachments into the doc one at 
a time.

NOTE:  Why is 'content-type' called 'content_type' inside the JSON?
  (I rearranged the names because my JSON encoder is putting them 
alphabetically)

--------PASTE-----------------------------------------
PUT /images/010123456789 HTTP/1.1
Content-Type: multipart/related;boundary="ABC010123456789"

--ABC010123456789
content-type: application/json

{
   "_attachments" : {
      "boo.txt" : {
         "content_type" : "text/plain",
         "follows" : true,
         "length" : 21
      },
      "far.txt" : {
         "content_type" : "text/plain",
         "follows" : true,
         "length" : 20
      }
   }
}

--ABC010123456789

this is 21 chars long
--ABC010123456789

this is 20 chars lon
--ABC010123456789--


Mime
View raw message