Giter Site home page Giter Site logo

Comments (4)

darrelmiller avatar darrelmiller commented on May 3, 2024 1

@johngossman @garethj-msft Arguably the client doesn't need to track any state to resolve a relative reference in a Location header RFC 7231 7.1.2 as a relative reference in a Location header is supposed to be relative to the request URL. In most client situations the request URL is available when processing the response.

It is some work on the part of the client however it should be something as straightforward as,

  var resolvedLocationUrl = new Uri(request.RequestUri, response.Headers.Location.OriginalString);

and this will work for both relative and absolute Location URLs, so the client doesn't even need to check.

from api-guidelines.

johngossman avatar johngossman commented on May 3, 2024

Generally we always want to use the full URL so the client doesn't have to track state.

from api-guidelines.

FlorianWendelborn avatar FlorianWendelborn commented on May 3, 2024

@johngossman I'm quite sure that the client needs to know which server he's trying to connect to, which would also be enough state to turn this back into the full URL. Depending on the framework used, it may even be easier to request a path on a server, instead of changing both every time.

But in general, I have to agree that not being forced to track state in the client is a good thing though.

from api-guidelines.

garethj-msft avatar garethj-msft commented on May 3, 2024

As John says, we're tending to standardize on absolute URLs, with the expectation that they require zero client manipulation. It is interesting feedback that you feel the path only may be easier with some frameworks.

from api-guidelines.

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.