-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Document apiFetch API (method) #19649
Copy link
Copy link
Closed
Labels
Good First IssueAn issue that's suitable for someone looking to contribute for the first timeAn issue that's suitable for someone looking to contribute for the first time[Type] Developer DocumentationDocumentation for developersDocumentation for developers
Metadata
Metadata
Assignees
Labels
Good First IssueAn issue that's suitable for someone looking to contribute for the first timeAn issue that's suitable for someone looking to contribute for the first time[Type] Developer DocumentationDocumentation for developersDocumentation for developers
Type
Fields
Give feedbackNo fields configured for issues without a type.
Is your feature request related to a problem? Please describe.
(apiRequest has been deprecated which obscures documentation on that package. )
https://github.com/WordPress/gutenberg/tree/master/packages/api-fetch does not document how to make requests to an HTTP POST endpoint. (And, this is difficult to search on because 'post' in wordpress api contexts can be a reference to the wp_posts table, or to content with entries in that table or specifically those which have post_type='post'.)
Describe the solution you'd like
documentation with examples at https://github.com/WordPress/gutenberg/tree/master/packages/api-fetch for an HTTP POST endpoint, analogous to what we see at, for example, https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/
Describe alternatives you've considered
I am currently using axios to work around this issue for one api call, despite the fact that wp.apiFetch works fine for me for the other calls I am using in that context.