Comments (6)
@hurelhuyag We support the Google interpretation of this. The trailing /
indicates a directory, and as such, we first attempt to serve the default content for a directory, namely index.html
. If the default resource is not there then the response is a 404.
https://developers.google.com/search/blog/2010/04/to-slash-or-not-to-slash
If you don't want this behavior then please don't place a /
at the end of a URL. Besides, if the ending /
follows a static file resource, or any other logical resource such as /resources/{id}/
rather than /resources/{id}
, what would be the purpose?
Another way to think about this is that if your server and client use hypermedia (HATEOS) then you should never have to hardcode any URL except for the initial root, which is minted. From there every next request should be guided by response headers and/or response entity content. This means that the server will provide hypermedia guidance according to its own rules.
from xoom-http.
@VaughnVernon Ok. Then which one is correct for our use case, http://localhost:18080/veterinarians
or http://localhost:18080/veterinarians/
?
from xoom-http.
(1) Assuming that http://localhost:18080/veterinarians
is meant to be a resource that is a collection of all individual veterinarian
resources, then it is the correct URI.
(2) This URL http://localhost:18080/veterinarians/
would indicate that there is a directory named veterinarians
, and we would attempt to read the index.html
from that directory. That I am sure would fail with a 404.
To make another point about 1, any veterinarian
resources in the response could/should have a URI for each one. In that way, you never have to build your own URI when making requests back to the server. Also, a further step to enable full hypermedia, your responses could even include request lines, such as GET ...
, PATCH ...
, PUT ...
, and DELETE ...
.
Note also that such request lines would be provided as K-V pairs. For example:
tag="QueryVeterinarian" link="http://localhost:18080/veterinarian/82821" type="GET"
After a successful query, other options could be provided:
tag="veterinarianSpecialty" link="http://localhost:18080/veterinarian/82821" method="PATCH"
tag="veterinarianResigned" link="http://localhost:18080/veterinarian/82821" method="DELETE"
from xoom-http.
Ok. I remembered something from xoom-starter. According to that rule, This uneditable trailing slash must be eliminated. Right?
from xoom-http.
Ok. I remembered something from xoom-starter. According to that rule, This uneditable trailing slash must be eliminated. Right?
Yes, I agree. I have asked numerous times for that change. I thought it had already been made. Perhaps @danilo-ambrosio has already made that change but not built the new binary artifact.
Would you please check and see if the change has been made? If not, please attempt to fix it and request @abdullahcalisir12 to review. Otherwise if it seems too difficult, please ask @abdullahcalisir12 to make the change.
from xoom-http.
The URL editing issue was fixed.
from xoom-http.
Related Issues (20)
- Allow RequestHandler* to return subclasses of Response HOT 15
- Support SSL HOT 5
- Eliminate Bare TestUntil Uses HOT 2
- Connection-based Async Client HOT 1
- Binary Request Body
- Need Filter Chain Support HOT 1
- The Fluent API with DynamicResource Is Not Correctly Creating Pool Instances HOT 1
- Request handler withFailure causes blocked response HOT 4
- Content-Type text/plain is not supported HOT 3
- When Action.disallowPathParametersWithSlash is set to false, incorrect URIs are matched HOT 3
- Refactor Header Case-Insensitive Matching HOT 1
- SocketChannel looping infinitely while handling probe interval HOT 1
- Race Condition When Dispatcher Pool Used By HttpAgent
- Race Condition On Heavy Load
- Response Without a Body Fails
- Request and Response Content-Length Must Use Bytes Count HOT 2
- Request response of exotic unicode characters seems broken HOT 4
- Support for compressed body POST/PUT media types HOT 7
- Security issue: caller can cause DoS via EOM error on server due to no limit on incoming sizes HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xoom-http.