Error 415 "Illegal Media Type" in every POST when using REST API

22 views
Skip to first unread message

Jesús Gimeno Sancho

unread,
Sep 27, 2021, 9:46:25 AM9/27/21
to scmmanager
Hi,
we are developing a python tool to create repositories automatically for our students. We are using the REST API successfully with GET messages (GETrepositories or users), but we are not able to perform any POST request. 
We have tried with several tools like postman, but we get allways the error code: 415 - Illegal Media Type.

The data within the POST message is a JSON and the header is configured with "Content-Type: application/json", and also the authentication is configured as it is working with GET requests.

The version of SCM Manager is 2.23

Eduard Heimbuch

unread,
Oct 15, 2021, 3:25:23 AM10/15/21
to scmmanager

Hey Jesus,

somehow your slipped through on our side. Sorry for the long wait. 

Have you checked on what media type is actually required? https://github.com/scm-manager/scm-manager/blob/3cb8fb52bb21b5b8e6618b8cb645d5a35893e126/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryCollectionResource.java#L164

The media-type you are looking for should be "application/vnd.scmm-repository+json;v=2". Generally I would suggest you to install the OpenAPI-Plugin (https://scm-manager.org/plugins/scm-openapi-plugin/). This might help a lot to understand and test the SCM-Manager REST API.

Best regards,
Eduard Heimbuch
Reply all
Reply to author
Forward
0 new messages