I
I
Ib0bI2019-06-15 18:46:22
WordPress
Ib0bI, 2019-06-15 18:46:22

Add image by API or POST?

Greetings.
How to specify the path to the file in api or post request?
Using "site/wp-json/wp/v2/media" I managed to create a media file and give it a name, but the photo itself did not load. I tried different attributes and types of requests, but nothing worked. I think the problem is in the correctness of specifying the path of the file to be loaded.
Request example

spoiler

{
"name": "1",
"title": "1",
"атрибут?": "C:/Users/1/1/1.png"
}

Thanks in advance for any help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Skibin, 2019-06-15
@megafax

Use the FILE API to upload a file to the server

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question