hi Don, Have you tried using the PHP libcurl function curl_setopt() to set the MIME type for your PHP curl call?
$header = array(); $header[] = "Content-Type: text/html"; ... other additions to $header, and then: curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); before you do your curl_exec() call. Regards, Jason On 3/3/10 2:49 PM, Don Gourley wrote: > When I add or modify a managed XML datastream using the REST API, I am > unable to get the correct mime-type on the datastreamVersion. For > example, > > curl -i -XPUT > "https://example.com:8443/fedora/objects/demo:29/datastreams/dctst?mimeType=text/xml&controlGroup=M&dsLabel=Test+mimeType" > --data-binary @dc.xml -k -u fedoraAdmin:****** > > creates a datastreamVersion like this: > > <foxml:datastreamVersion ID="dctst.5" LABEL="Test mimeType" > CREATED="2010-03-03T18:10:23.286Z" > MIMETYPE="application/x-www-form-urlencoded"> > <foxml:contentLocation TYPE="INTERNAL_ID" REF="demo:29+dctst+dctst.5"/> > </foxml:datastreamVersion> > > (I've tried it url-encoded with the mimeType=text%2Fxml also) > > I know that I can add -H "Content-Type: text/xml" to the cURL command > and get the right mime-type in the datastreamVersion, but the problem > is that I am trying to write client application using PHP and libcurl > and adding a content-type request header doesn't work with that mix. > And the mimeType parameter is supposed to override the request header > anyway, or am I not using it correctly? > > I am trying to update a Fedora 3.1 repository. > > thanks, > -Don > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Fedora-commons-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/fedora-commons-users > -- Jason Nugent Systems Programmer/Database Developer Electronic Text Centre University of New Brunswick [email protected] (506) 447 3177 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Fedora-commons-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fedora-commons-users
