curl --request POST \
--url https://gogs.example.com/api/v1/users/{username}/tokens \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'{
"name": "<string>",
"sha1": "<string>"
}Requires basic authentication.
curl --request POST \
--url https://gogs.example.com/api/v1/users/{username}/tokens \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'{
"name": "<string>",
"sha1": "<string>"
}Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Username