I tried the following request:
curl -v -X POST --header "PRIVATE-TOKEN:myPrivateToken" 'url-of-gitlab/api/v3/projects/myProjectId/repository/files?file_path=1.json&branch_name=master&content=thefilecontent&commit_message=ACommitMessage'
However, I invariably get
"message":"You can only create files if you are on top of a branch"
in the response. I don't know what's missing from my request. The repository is newly created and I created it through the Gitlab UI. Maybe I need to create a branch first? Any help would do. Thank you very much.