JulianFrattini / cira

Python package for functions around the causality in requirements artifacts (CiRA) initiative.
http://www.cira.bth.se/
Apache License 2.0
10 stars 1 forks source link

Update HTTP Methods to comply to Fetch Standard #40

Closed JulianFrattini closed 1 year ago

JulianFrattini commented 1 year ago

According to the fetch standard, a http-compliant GET request should not contain a body. However, the API in app.py contains GET endpoints that require a body.

While some clients (e.g., Postman) allow deviation from the fetch standard, other clients (e.g., the fetch library in JavaScript) will cause something like the following error message: TypeError: Window.fetch: HEAD or GET Request cannot have a body. This makes the CiRA functionality unusable as one container within a composition, e.g., as the backend to a web interface.

Consequently, it is suggested to update the HTTP method of all API endpoints that require a body from GET to POST.

andreas-bauer commented 1 year ago

Please have a look at Mozilla's documentation to determine which HTTP method could be used.

JulianFrattini commented 1 year ago

According to the classification, the request should be a GET, which is not allowed by the fetch specifications. What method would you recommend?

JulianFrattini commented 1 year ago

Or is it actually a GET method and our approach of requiring a body for the function is wrong?

andreas-bauer commented 1 year ago

My recommendation: