GithubHelp home page GithubHelp logo

Comments (6)

VaughnVernon avatar VaughnVernon commented on June 14, 2024 1

@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.

hurelhuyag avatar hurelhuyag commented on June 14, 2024

@VaughnVernon Ok. Then which one is correct for our use case, http://localhost:18080/veterinarians or http://localhost:18080/veterinarians/?

from xoom-http.

VaughnVernon avatar VaughnVernon commented on June 14, 2024

(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.

hurelhuyag avatar hurelhuyag commented on June 14, 2024

Ok. I remembered something from xoom-starter. According to that rule, This uneditable trailing slash must be eliminated. Right?

Screenshot from 2021-03-16 11-45-40

from xoom-http.

VaughnVernon avatar VaughnVernon commented on June 14, 2024

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.

VaughnVernon avatar VaughnVernon commented on June 14, 2024

The URL editing issue was fixed.

from xoom-http.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.