GALAglobal / translationapi

The API is for anyone who wants to adopt best practices for a translation services API to interact with counterparts directly from your application or content management system. The API helps ensure interoperability for the most common tasks.
https://translate.taus.net/translate/taus-translation-api
MIT License
12 stars 3 forks source link

PUT works as POST for translation request #26

Closed achimr closed 9 years ago

achimr commented 9 years ago

Steps to repro:

  1. Start the server with "node tausapiserver.js"
  2. PUT the following content to http://localhost:3412/v2.0/translation/ (the translation request does not yet exist on the server) { "translationRequest": { "id": "2b575fdc-f6af-4b9e-850d-9dc0884c6596", "sourceLanguage": "de-CH", "targetLanguage": "en-US", "source": "Gruez di Welt", "professional": true, "mt": false, "creationDatetime": "2014-05-20T19:20+01:00", "updateCounter": 0, "status": "initial" } } Result: Returns HTTP 201 Resource created

Expected: Rejection of request because translation request does not exist yet.

heartsomeXPhantom commented 9 years ago

POST vs PUT: "PUT: If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new resource by the requesting user agent, the origin server can create the resource with that URI." In this case as above the request can be created as enough information is available and therefore request is not rejected but created.

achimr commented 9 years ago

Sounds fine.