Probably a very simple problem that belies that I’m not that familiar with Unix commands. Trying to create a repository using the Gitea API. I’ve got it working to check if a repository exists but this is the curl I’m trying to execute to create a test repository:
curl.exe -k -H “content-type: application/json” -H “Authorization: token xxx” https://gitea.mydomain.co.uk:3000/api/v1/user/repos -d ‘{“name”: “test1”}’
And I get this result:
{“message”:“: invalid character ‘n’ looking for beginning of value”,“url”:“https://gitea.mydomain.co.uk:3000/api/swagger”}
It’s clearly a problem with the JSON I’m trying to pass, i.e. if I change “name” to “xame”, the invalid character is ‘x’.
Later… since posting the above in another topic (bad form), I’ve got it working using PowerShell Invoke-WebRequest. I’m executing curl from a PowerShell script anyway so this is perfectly fine and slightly cleaner.
Still intrigued what I’m doing wrong though with the curl command.