ogcapi-features icon indicating copy to clipboard operation
ogcapi-features copied to clipboard

Part 4: Create: returning the created feature in the body of the response ?

Open rouault opened this issue 1 year ago • 4 comments

When creating a feature, the server may compute automatically some fields (UUIDs, timestamps, etc.) that the client may wish. Currently it needs to follow the Location header returned by the 201 response. It could be worth to have a way of getting the updated feature representation, returned as the body of the response, to save a client-server round-trip. If we don't want to impose such behaviour as required, that could be done through some "Return-Created-Feature: true" request header, optionally honored by the server.

(triggered by https://github.com/qgis/QGIS/issues/57486)

rouault avatar May 23 '24 17:05 rouault

Meeting 2024-06-03: Having the possibility to get the representation in the response sounds like a useful option. The default behavior should be to not require content in the response.

cportele avatar Jun 03 '24 14:06 cportele

Is this really needed? What's the issue with following the Location header?

m-mohr avatar Jul 16 '24 10:07 m-mohr

Meeting 2025-03-24: Some implementations already support this capability, so it would make sense to include this in a consistent way in the spec - as an option. @pvretano will create a PR also based on their implementation experience. A header to request the feature in the response sounds like a good approach.

cportele avatar Mar 24 '25 14:03 cportele

@pvretano - We should use the standard Prefer header for this, which already covers this use case. See https://www.rfc-editor.org/rfc/rfc7240.html#section-4.2.

If the "return" preferences are supported, "return=representation" would return the resources and "return=minimal" would return no content.

cportele avatar Sep 18 '25 10:09 cportele