Giter Club home page Giter Club logo

Comments (11)

sandro avatar sandro commented on June 22, 2024

Makes sense to me but I'd like to get more feedback from the community before committing to it.

from httparty.

nkabbara avatar nkabbara commented on June 22, 2024

Cool. Le me know if I can help.

from httparty.

sandro avatar sandro commented on June 22, 2024

I'd love to see a patch/gist demonstrating a backwards compatible response object which inherits (or simply quacks) like a Net:HTTTP response.

from httparty.

sandro avatar sandro commented on June 22, 2024

Oops, sorry...that comment was meant for another issue. Anyways, patches are always welcome!

from httparty.

tinco avatar tinco commented on June 22, 2024

Hey guys,

I ran into this in a project I'm doing and made a quick fix:

http://gist.github.com/323465

It's not very elegant, but it does the job for me. I made the patch in my project as you can see, if someone would like me to make a fork and commit it there send me a message and I will :)

(edit: made a revision to the patch (how meta) obviously nil isn't a Hash either :P)

from httparty.

subimage avatar subimage commented on June 22, 2024

Is anyone making HTTParty speak the request format? For instance, build a XML string when requesting XML, etc?

from httparty.

sandro avatar sandro commented on June 22, 2024

I'm not working on this but not against merging the patch. Are we suggesting that setting the format automatically sets the accept header and converts the body string to XML/JSON? I'm okay with setting the accept header but converting the body seems a bit much.

from httparty.

subimage avatar subimage commented on June 22, 2024

The majority (all?) of the APIs I've encountered expect you to speak what you request. Only makes sense to me to do that. I've resorted to encoding my own XML sending over the wire for now...but +1 for the idea from me.

At the very least perhaps offer an option to speak what you request?

from httparty.

kalasjocke avatar kalasjocke commented on June 22, 2024

Did this ever get implemented? I want to send json objects to a api but i cant figure out how to do it, is this possible with the lastest version of HTTParty?

from httparty.

tinco avatar tinco commented on June 22, 2024

Hey @kalasjocke I've submitted a pull request for my patch, #96 or you can just use my fork: https://github.com/d-snp/httparty/tree/request_content_type

It was a long time ago that I used this so I'm not sure if this fixes all problems.

from httparty.

kalasjocke avatar kalasjocke commented on June 22, 2024

Alright, nice work @d-snp! Maybe i will use your fork in my project then, thanks!

from httparty.

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.