Hi Stuart
 
POST-ing to a /fedora/objects/{pid}/datastreams/{dsID} is valid in two
contexts:
 
1: adding a new datastream 
2: modifying a datastream using the POST replacement detailed on the REST
API documentation page [1] - but in that case the X-HTTP-Method-Override
header needs setting, which I guess you are not doing.
 
And in the case of (1) with an existing datastream already existing, I think
I'd expect an error.
 
So technically it does look like this could be a bug.  Could you verify with
your older code that there was no warning/error being logged in the Fedora
log file?  If that's the case, please do log a bug.
 
Regards
Steve

-----Original Message-----
From: Stuart Chalk [mailto:[email protected]] 
Sent: 17 May 2010 12:16
To: [email protected]
Cc: Steve Bayliss
Subject: Re: [Fedora-commons-users] New version of stream on URL request


Steve 

Yes, I found I was POSTing rather than GETting to the
getDatastreamDissemination method.
Should this be reported as a bug?  I would rather it report an error on POST
rather than look
like its working fine but in fact making a version every time.

Stuart

On May 16, 2010, at 7:08 AM, Steve Bayliss wrote:


Hi Stuart
 
My gut feel here is that a POST or PUT is actually happening.  You could
maybe verify this by looking at the tomcat log files (you might need to up
the logging level).
 
Do you have some sample code for how you're actually performing the request?


Regards
Steve

-----Original Message-----
From: Stuart James Chalk [mailto:[email protected]] 
Sent: 14 May 2010 16:59
To: [email protected]
Subject: [Fedora-commons-users] New version of stream on URL request


I have configured a PHP based application to interface with the Fedora
REST-API (v 3.3) and can successfully access the web interface/pages for
management methods using authentication. 

My problem is that when I do this from my PHP application and access the
data for an objects stream, it creates a new version of the stream!  I can
access the same method (URL) via a web browser and not get this behavior,
thus I assume that I need the correct configuration of the headers in the
request from PHP to stop the new version creation.

Below are the current values for the header info I am using

'method' => 'GET',
'uri' => array(
'scheme' => 'http',
'host' => null,
'port' => 80,
'user' => null,
'pass' => null,
'path' => null,
'query' => null,
'fragment' => null
),
'auth' => array(
'method' => 'Basic',
'user' => null,
'pass' => null
),
'version' => '1.1',
'body' => '',
'line' => null,
'header' => array(
'Connection' => 'close',
'User-Agent' => 'CakePHP'
),
'raw' => null,
'cookies' => array()

Does anyone have any ideas what needs to be changed to stop a new version
being created each time the stream is accessed?  Is this a bug?




Stuart Chalk, Ph.D.
Associate Professor of Chemistry
Department of Chemistry, University of North Florida
1 UNF Drive, Jacksonville, FL 32224 USA
P: 904-620-1938
F: 904-620-3535
E: [email protected]
W: http://www.unf.edu/coas/chemistry/



------------------------------------------------------------------------------

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

Reply via email to