@@ -49,7 +49,7 @@ Note that `/users/:name/tokens` is a special endpoint and requires you
49
49
to authenticate using ` BasicAuth ` and a password, as follows:
50
50
51
51
``` sh
52
- $ curl -XPOST - H " Content-Type: application/json" -k -d ' {"name":"test"}' -u username:password https://gitea.your.host/api/v1/users/< username> /tokens
52
+ $ curl -H " Content-Type: application/json" -k -d ' {"name":"test"}' -u username:password https://gitea.your.host/api/v1/users/< username> /tokens
53
53
{" id" :1," name" :" test" ," sha1" :" 9fcb1158165773dd010fca5f0cf7174316c3e37d" ," token_last_eight" :" 16c3e37d" }
54
54
```
55
55
@@ -58,7 +58,7 @@ plain-text. It will not be displayed when listing tokens with a `GET`
58
58
request; e.g.
59
59
60
60
``` sh
61
- $ curl --
request GET -- url https://yourusername:
[email protected] /api/v1/users/
< username
> /tokens
61
+ $ curl --url https://yourusername:
[email protected] /api/v1/users/
< username
> /tokens
62
62
[{" name" :" test" ," sha1" :" " ," token_last_eight:" ........" :},{" name" :" dev" ," sha1" :" " ," token_last_eight" :" ........" }]
63
63
` ` `
64
64
@@ -70,7 +70,7 @@ is where you'd place the code from your authenticator.
70
70
Here is how the request would look like in curl:
71
71
72
72
` ` ` sh
73
- $ curl -H " X-Gitea-OTP: 123456
" --request GET -- url https://yourusername:[email protected] /api/v1/users/yourusername/tokens
73
+ $ curl -H " X-Gitea-OTP: 123456
" --url https://yourusername:[email protected] /api/v1/users/yourusername/tokens
74
74
` ` `
75
75
76
76
You can also create an API key token via your Gitea installation' s web
@@ -96,7 +96,7 @@ Authorization: token 65eaa9c8ef52460d22a93307fe0aee76289dc675
96
96
In a ` curl` command, for instance, this would look like:
97
97
98
98
` ` ` sh
99
- curl -X POST " http://localhost:4000/api/v1/repos/test1/test1/issues" \
99
+ curl " http://localhost:4000/api/v1/repos/test1/test1/issues" \
100
100
-H " accept: application/json" \
101
101
-H " Authorization: token 65eaa9c8ef52460d22a93307fe0aee76289dc675" \
102
102
-H " Content-Type: application/json" -d " { \" body\" : \" testing\" , \" title\" : \" test 20\" }" -i
0 commit comments