I'm stumbling through getting a piece of PHP code working that takes a  
saved XML file and sends a REST POST
using the REST API (Fedora 3.1).  My code is as follows...

$fields=array();
$farray=array(array("name"=>"XMLFile","type"=>"text/xml","file"=> 
$filename));
$oarray=array("httpauth"=>"fedoraAdmin:password");
echo 
http_post_fields('http://localhost:8080/fedora/objects/article:test?label=testobject&logMessage=RESTtest',$fields,$farray,$oarray)
 
;
                
The result from sending this request is

HTTP/1.1 100 Continue HTTP/1.1 415 Unsupported Media Type Server:  
Apache-Coyote/1.1 Content-Type: text/html;charset=utf-8 Content- 
Length: 1051 Date: Sat, 27 Dec 2008 01:37:38 GMT

HTTP Status 415 -

type Status report

message

description The server refused this request because the request entity  
is in a format not supported by the requested resource for the  
requested method ().
Apache Tomcat/5.5.26

Anyone done this already?  If not, how do I look at a log for the  
Coyote connector to get clues as the problem...

Stuart Chalk, Ph.D.
Associate Professor of Chemistry
Department of Chemistry and Physics
University of North Florida
1 UNF Drive
Jacksonville, FL 32224 USA
P: 904-620-1938
F: 904-620-1989
E: [email protected]




------------------------------------------------------------------------------
_______________________________________________
Fedora-commons-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fedora-commons-users

Reply via email to