Hi,
I have a problem with rest api Post method for an entity.
I tried to insert new record of entity with postman but I have error 405 as response
HTTP Status 405 – Method Not Allowed
In tomcat log I have this error:
org.springframework.web.HttpRequestMethodNotSupportedException: Request method ‘POST’ not supported
I have already set rights to entity and to attribute in user’s roles.
Others method such as Get, Put,Delete function correctly.
How can I resolve the problem?
Hi Konstantin,
sorry for late, this are particular days.
Happy new year to all.
This is my request:
curl -H “Authorization: Bearer 5e45dbd9-40c4-4ac5-8472-185625d073fd” -H “Content-Type: application/json” -X POST -d “{”_entityName": “app_An”,“_instanceName”: “com.company.app.entity.An-001 [detached]”,“id”: “001”,“descrizione”: “MACELLERIA”,“codice”: “001”,“version”: 0}" http://localhost:8080/Storeapp/rest/v2/entities/app_An/001
and this is response:
curl: (3) [globbing] bad range in column 2
<!doctype html>HTTP Status 405 – Method Not Allowedbody {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}
HTTP Status 405 – Method Not Allowed
Type Status Report
Message Request method 'POST' not supported
Description The method received in the request-line is known by the origin server but not supported by the target resource.
Quick googling of “[globbing] bad range in column 2” gives you the hint.
Probably you should remove square brackets from _instanceName property. Actually, sending instance name has no effect at all.