Giter VIP home page Giter VIP logo

Comments (2)

trevor-scheer avatar trevor-scheer commented on August 28, 2024

Hey @rjoaopereira, sorry for the delay in responding to this.

Can you help me understand what you're trying to do that this behavior is breaking?

  • Do you want to set a body as a plain text (double-quote escaped?) string and have us still set the application/json header since it's valid JSON?
  • Are you trying to pass in already stringified JSON as the body and have us recognize that and set the header?

For 1: I'm not sure I see the value, but if this is your use case I'm interested to hear about it. Why is it useful to set that header?
For 2: I think this adds a fair amount of overhead to look at every string body, try and parse it, then assign the header if it succeeds (unless there's a better, faster way to detect valid JSON). Would parsing the object in the resolver or in the fails() function be reasonable?

This can be worked around right now (in the v3 version) by using the willSendRequest hook to inspect the body and set the header yourself if you choose to do that. Unfortunately this can't be done in v4 yet due to a separate issue (which I have a PR open for).

from datasource-rest.

trevor-scheer avatar trevor-scheer commented on August 28, 2024

We think this is working as intended. Happy to discuss further.

from datasource-rest.

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.