-
Notifications
You must be signed in to change notification settings - Fork 1.6k
PHP WordPress Rest API Example
Justice Ogbonna edited this page Jun 26, 2017
·
3 revisions
In the front-end
$scope.upload = function (file) {
Upload.upload({
url: 'http://localhost/wp-json/wp/v2/media',
method: 'POST',
file: file,
headers: {
"Content-Disposition": 'attachment; filename=' + file.name,
"Content-Type": file.type,
"Cache-Control": "no-cache",
"Data-Binary": file.name
}
})