Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#55851 closed enhancement (reported-upstream)

Document "/media" REST endpoint file upload mechanics

Reported by: tstephens's profile tstephens Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.1
Component: REST API Keywords: needs-docs
Focuses: rest-api Cc:

Description

The REST v2 /media endpoint reference at https://developer.wordpress.org/rest-api/reference/media/#create-a-media-item would benefit from a mention of file content upload mechanics. The first technique documented in this gist I found:

https://gist.github.com/ahmadawais/0ccb8a32ea795ffac4adfae84797c19a

(set the 'Content-Disposition' HTTP header field to 'form-data; filename="thefile.jpg"' and send the file's content as the HTTP body data) ended up working for me, but it would be helpful to have official documentation on this embedded in or linked from the /media endpoint reference.

Change History (3)

This ticket was mentioned in Slack in #core-restapi by tstephens. View the logs.


3 years ago

#2 follow-up: @TimothyBlynJacobs
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed

Hi @tstephens,

Welcome to Trac! Documentation for the WP-API developer reference is handled in GitHub. Would you mind opening an issue there?

https://github.com/wp-api/docs

#3 in reply to: ↑ 2 @tstephens
3 years ago

Replying to TimothyBlynJacobs:

Hi @tstephens,

Welcome to Trac! Documentation for the WP-API developer reference is handled in GitHub. Would you mind opening an issue there?

https://github.com/wp-api/docs

Thank you, @TimothyBlynJacobs! I've filed https://github.com/WP-API/docs/issues/129 there, so this ticket can indeed be closed. Sorry for starting this out in the wrong system!

Note: See TracTickets for help on using tickets.