Skip to content

Document apiFetch API (method) #19649

@rdm

Description

@rdm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueAn issue that's suitable for someone looking to contribute for the first time[Type] Developer DocumentationDocumentation for developers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions