Yeah, the "multipart file as request content" in the documentation 
parameter had me scratching my head, too. I suspect it simply means 
"external file to send along in the request", which curl simply PUTS as 
the body of the request.  The same curl command line, with the "-v" 
option to show request headers also, returns this:

curl -v -i -X PUT --upload-file t2.xml -u fedoraAdmin:XXXXXX 
'http://localhost:8080/fedora/objects/test:t1/datastreams/DCTERMS?dsLabel=DCMI%20Record&versionable=false&dsState=A&mimeType=text/xml'

* About to connect() to localhost port 8080
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080
* Server auth using Basic with user 'fedoraAdmin'
 > PUT 
/fedora/objects/test:t1/datastreams/DCTERMS?dsLabel=DCMI%20Record&versionable=false&dsState=A&mimeType=text/xml
 
HTTP/1.1
 > Authorization: Basic ZmVkb3JhQWRtaW46dHVybmlw
 > User-Agent: curl/7.15.5 (i386-redhat-linux-gnu) libcurl/7.15.5 
OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
 > Host: localhost:8080
 > Accept: */*
 > Content-Length: 492
 > Expect: 100-continue

I'll update the documentation to clarify that bit.

-- Scott

On 09/26/2012 09:22 AM, Alistair Young wrote:
> thanks for that Scott. I also tried what you suggested with the raw
> DCTERMS xml but it gave the same error. I tracked it down to Fedora 3.5:
>
> org.fcrepo.server.management.DefaultManagement::getXML.
>
> It passes the InputStream straight to the DocumentBuilder along with the
> multipart stuff (which the docs say to use):
> --268504
> Content-Disposition: form-data; name="file"; filename="dcterms"
> Content-Type: text/plain
>
> and hence it fails to parse. Sending the XML in the body of the request
> sorts the problem.
>
> Not sure why the docs say to use multipart as it stops xml being parsed.
>
> thanks for your help Scott. That commandline was helpful.
>
>
> Alistair
>

curl -v -i -X PUT --upload-file t2.xml -u fedoraAdmin:turnip 
'http://localhost:9091/fedora/objects/test:t1/datastreams/DCTERMS?dsLabel=DCMI%20Record&versionable=false&dsState=A&mimeType=text/xml'
* About to connect() to localhost port 9091
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 9091
* Server auth using Basic with user 'fedoraAdmin'
 > PUT 
/fedora/objects/test:t1/datastreams/DCTERMS?dsLabel=DCMI%20Record&versionable=false&dsState=A&mimeType=text/xml
 
HTTP/1.1
 > Authorization: Basic ZmVkb3JhQWRtaW46dHVybmlw
 > User-Agent: curl/7.15.5 (i386-redhat-linux-gnu) libcurl/7.15.5 
OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
 > Host: localhost:9091
 > Accept: */*
 > Content-Length: 492
 > Expect: 100-continue

-- 
Scott Prater
Shared Development Group
General Library System
University of Wisconsin - Madison
[email protected]
5-5415

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Fedora-commons-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fedora-commons-users

Reply via email to