I guess this is a common question but I can't find an answer that
works, let alone documentation.
I'm trying to integrate ODK Collect with my own server and I can
process the submission pretty easily, but I don't know how to respond
so that the client doesn't think that the submission has failed.
How should I build an "OK" response from the server?
According to this you simply have to generate a 201 http response with
a Location header pointing to a location within the same server, but
that doesn't work.
"You MUST add a "Location" header
This location header MUST be part of the url that ODK submitted to. (If
you're sneaky you can always just set the Location header to "h", "t",
"p",
":", or ".", but you should probably use the real server location in case
ODK decides to change this on you.)
Well the real server location doesn't work, "http://" does.
···
On 09/23/2011 08:29 PM, Matteo Sisti Sette wrote:
"You MUST add a "Location" header
This location header MUST be part of the url that ODK submitted to. (If
you're sneaky you can always just set the Location header to "h", "t",
"p",
":", or ".", but you should probably use the real server location in case
ODK decides to change this on you.)
Well the real server location doesn't work, "http://" does.
···
On 09/23/2011 08:47 PM, Mitch Sundt wrote:
> The Location header is expected to be a fully-formed URL (e.g.,
> http://www.opendatakit.appspot.com).
>
> Collect looks for a matching prefix of this header. So if your server
> will be running with HTTPS, you'd need to return "https://"
Yes, that's what I'm doing (otherwise, it wouldn't work even with
location "http://")
I suspect that maybe the location url must be STRICTLY a substring of
the server url, but not the whole server string itself?
···
On 09/23/2011 09:55 PM, Christopher Swenson wrote:
> You also need to make sure that you send a 201 code (not 200, as you
> might otherwise expect).
I suspect that maybe the location url must be STRICTLY a substring of
the server url, but not the whole server string itself?
No, the only thing that works is just "http://" or any substring of it,
i.e.:
Location: http://
Location: http:/
Location: htt
Location: h
Location: tp