Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
URL redirection when www.fairdomhub.org is used in API create #105
When trying to create objects by API at FAIRDOMhub, I used a wrong address, namely
Instead of creating an object (e.g. a study as listed below) the response was a list of studies. It seems that www prefixed address is good for GET but not for POST/PUT.
When using the www prefixed address, API requests are redirected (HTTP/1.1 302 Found) to the correct one (no www), but the object is not created. Details of communication is listed below.
Since www prefix is ok for reading, it is confusing when the writing doesn't work - I suggest that API checks the correctness of the URL and returns an informative error (Wrong URL, omit www, or something like that) instead of returning a list of objects (with 200 OK).
The communication transcript of unsuccesful study creation is below:
-> POST /studies HTTP/1.1
<- HTTP/1.1 302 Found