[wp-trac] [WordPress Trac] #48257: REST API: post-process endpoint cannot be discovered from media creation endpoint
WordPress Trac
noreply at wordpress.org
Tue Oct 8 14:24:14 UTC 2019
#48257: REST API: post-process endpoint cannot be discovered from media creation
endpoint
--------------------------+----------------------------
Reporter: kadamwhite | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: REST API | Version: trunk
Severity: normal | Keywords: needs-patch
Focuses: rest-api |
--------------------------+----------------------------
Split out from #47987:
In #47987 we introduced a new `/wp/v2/media/{id}/post-process` endpoint,
which may be hit with a POST to resume media processing in the event the
initial POST to `/wp/v2/media` fails. Clients may know to utilize this new
endpoint through the presence of a new non-standard header `X-WP-Upload-
Attachment-ID`, but @rmccue caught that we do not provide any Link-based
method of discovering the existence of this endpoint from the initial
media collection. @TimothyBlynJacobs proposes using the `edit-media`
relation for this link.
We should add an additional `Link` to the header of the failing POST
response (or any POST response, potentially, with the understanding a link
is only necessary in the event of failure). Implementing this Link was
punted from 5.3 because the `$response` object on which we can call
add_link was not available at the time we set the initial X-header, which
we can work around but did not have time to resolve before the final 5.3
beta.
''Aside:'' If we're able to resolve the order-of-operations issue, it's
possible that the Link could become the preferred method of signalling
that post-processing should occur, rather than the non-standard header.
However the X-header is more appropriate for the other media paths in
`media.php` and `admin-ajax.php`, so this may not be feasible.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48257>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list