Add support for file uploads
This commit is contained in:
parent
dcd0082e83
commit
8bbc782b96
8 changed files with 62 additions and 13 deletions
|
|
@ -2,7 +2,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<script>
|
||||
var authUrl = 'authorize.php'; // hostname ending in '.auth0.com'
|
||||
var authUrl = 'auth.php'; // hostname ending in '.auth0.com'
|
||||
var clientId = 'default'; // client id as defined in auth0
|
||||
var audience = 'api.php'; // api audience as defined in auth0
|
||||
window.onload = function () {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ window.onload = function () {
|
|||
document.getElementById('output').innerHTML = JSON.stringify(JSON.parse(req.responseText), undefined, 4);
|
||||
}
|
||||
}
|
||||
url = 'http://127.0.0.3/api.php/records/posts?join=categories&join=tags&join=comments&filter=id,eq,1';
|
||||
url = '/api.php/records/posts?join=categories&join=tags&join=comments&filter=id,eq,1';
|
||||
req.open("GET", url, true);
|
||||
req.setRequestHeader('X-Authorization', 'Bearer '+accessToken);
|
||||
req.send();
|
||||
|
|
|
|||
12
examples/clients/upload/form.html
Normal file
12
examples/clients/upload/form.html
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
|
||||
<form action="api.php/records/categories" method="post" enctype="multipart/form-data">
|
||||
<input type="text" name="name" value="upload">
|
||||
<input type="file" name="icon">
|
||||
<input type="submit" value="upload">
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue