Git Product home page Git Product logo

Comments (6)

localvar avatar localvar commented on May 24, 2024

Yes, the 1st one is the correct way.

The 2nd: it is a bug, we have set the 'Content-Type' to 'application/json' in the code, but it is not working. I will fix it.
The 3rd: we have to keep it as it is, the mesh APIs return JSON and the Easegress APIs return YAML by default, and this is an Easegress one.
The 4th: as the status code is not 2XX and the body is empty, all APIs haven't set the content type, can we just ignore it?

from easemesh.

zhao-kun avatar zhao-kun commented on May 24, 2024

About 4th, I agree @pengjiejason , we need to uniform content-type settings.

from easemesh.

zhao-kun avatar zhao-kun commented on May 24, 2024

I think we need to clarify our API contract:

  • API for the EaseMesh should set Content-Type: application/json no matter the status code is 2XX or others.
  • API for the Easegress should set Content-Type: text/vnd.yaml no matter the status code is 2XX or others.
  • Path start with /apis/v1/mesh is an API for the EaseMesh.
  • Path start with /apis/v1/objects is an API for the Easegress.

from easemesh.

localvar avatar localvar commented on May 24, 2024

For non-2XX responses, theoretically, it is possible that the request hasn't been processed by our code, so I think the client should not be so strict on them.

from easemesh.

zhao-kun avatar zhao-kun commented on May 24, 2024

Yes, the request hasn't been processed the Content-type can be undefined, but if the request has been processed, sever should return Content-Type in a consistent way (it's doesn't matter with the client, it's the server's behavior, the server's behavior should be consistency).

from easemesh.

localvar avatar localvar commented on May 24, 2024

the 2nd issue has been fixed in PR easegress-io/easegress#430.
the 4th is a little complex and needs more time to fix.

from easemesh.

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.