api first
parent
7333e95943
commit
d30a6abd50
@ -0,0 +1,17 @@
|
|||||||
|
let headers = new Headers();
|
||||||
|
headers.append("Authorization", "Bearer 53fee4e31a06d538bd18562e7eb3450ce714e63f");
|
||||||
|
|
||||||
|
var formdata = new FormData();
|
||||||
|
formdata.append("name", "exercices");
|
||||||
|
|
||||||
|
var options = {
|
||||||
|
method: 'POST',
|
||||||
|
headers: headers,
|
||||||
|
body: formdata,
|
||||||
|
redirect: 'follow'
|
||||||
|
};
|
||||||
|
|
||||||
|
fetch("https://forge.gwenaelremond.fr/api/v1/user/repos", options)
|
||||||
|
.then(response => response.text())
|
||||||
|
.then(result => console.log(result))
|
||||||
|
.catch(error => console.log('error', error));
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
"""
|
||||||
|
curl -X 'POST' \
|
||||||
|
'https://forge.gwenaelremond.fr/api/v1/admin/users' \
|
||||||
|
-H 'accept: application/json' \
|
||||||
|
-H 'Authorization: token XXXX'\
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
-d '{
|
||||||
|
"email": "user@example.com",
|
||||||
|
"full_name": "dupont",
|
||||||
|
"login_name": "dupont",
|
||||||
|
"must_change_password": true,
|
||||||
|
"password": "blabla%TulPoint45",
|
||||||
|
"restricted": true,
|
||||||
|
"send_notify": false,
|
||||||
|
"source_id": 0,
|
||||||
|
"username": "dupont"
|
||||||
|
|
||||||
|
}'
|
||||||
|
"""
|
||||||
|
|
||||||
Loading…
Reference in New Issue