GithubHelp home page GithubHelp logo

Comments (9)

dflock avatar dflock commented on April 28, 2024 2

Now with the --json, -j option HTTPie tries to detect JSON responses when the Content-Type is unknown or text/plain.

Right, but there's still no way to force it, so if the Content-Type is text/html but the content is JSON, then you're still out of luck - you have to pipe through jq or something.

Given the number of poorly configured REST API endpoints in the world, having the option to force/override the Content-Type seems like a valid request.

from httpie.

RogWilco avatar RogWilco commented on April 28, 2024

Ah, I see this is related to #67 which seems to address this very need. Closing ticket...

from httpie.

RogWilco avatar RogWilco commented on April 28, 2024

Actually, looks like that change didn't make it in. Any chance something similar could be added in? Maybe a way to override the response headers with user-specified values (similar to the headers argument, but for responses)?

from httpie.

 avatar commented on April 28, 2024

👍
This would be nice to have. Some servers respond with Content-Type: text/html and JSON bodies.

from httpie.

marko-asplund avatar marko-asplund commented on April 28, 2024

+1

from httpie.

jlandahl avatar jlandahl commented on April 28, 2024

+1

from httpie.

dequis avatar dequis commented on April 28, 2024

FWIW, i'm workarounding invalid content type responses by piping the output to jq

from httpie.

kfix avatar kfix commented on April 28, 2024

see #368

from httpie.

jkbrzt avatar jkbrzt commented on April 28, 2024

Now with the --json, -j option HTTPie tries to detect JSON responses when the Content-Type is unknown or text/plain.

from httpie.

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.