Response to header request of ODK-Collect

Hi,

I'm trying to write a very simple server script in php to handle
submissions from ODK Collect. I already got it to work with Collect
1.1.5 but it doesn't work with 1.1.7 because of the changes in the protocol.

I've had a hard time trying to find some documentation about how the
client behaves and how it expects the server to behave. The only
documentation seems to be the source code itself.

So I had a look at the source code of ODK Collect and I seem to
understand that when ODK Collect does a HTTP HEAD request to /submission
with the correct login credentials, it expects a "204 No Content"
response AND a Location header. If there is no Location header, it will
give a "FAILED: network login?" error which is exactly what I am
experiencing.

So my question is: isn't 204 + Location a violation of HTTP protocol
specification? I thought that the Location header could only be used in
conjunction with 3xx responses OR with "201 created".

This may be why I am not being able to return such a header with such a
response in PHP. PHP seems to force a 302 response when I issue a
Location header (but it does allow me to issue a Location header with a
204 response).

Or am I missing something?

thanks
m.

This may be why I am not being able to return such a header with such a
response in PHP. PHP seems to force a 302 response when I issue a
Location header (but it does allow me to issue a Location header with a
204 response).

I meant: it does allow me to issue a Location header with a 201
response, not 204, obviously

··· On 09/25/2011 08:01 PM, Matteo Sisti Sette wrote:

You appear to be correct about the Location header: although it isn't in
violation of the HTTP protocol, it is more of an abuse of that header field:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30

I also found that sending a 400 works too.

--Christopher

··· On Sun, Sep 25, 2011 at 2:03 PM, Matteo Sisti Sette < matteosistisette@gmail.com> wrote:

On 09/25/2011 08:01 PM, Matteo Sisti Sette wrote:

This may be why I am not being able to return such a header with such a

response in PHP. PHP seems to force a 302 response when I issue a
Location header (but it does allow me to issue a Location header with a
204 response).

I meant: it does allow me to issue a Location header with a 201 response,
not 204, obviously

--
Christopher Swenson
cswenson@google.com