Comments (11)
Makes sense to me but I'd like to get more feedback from the community before committing to it.
from httparty.
Cool. Le me know if I can help.
from httparty.
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.
Oops, sorry...that comment was meant for another issue. Anyways, patches are always welcome!
from httparty.
Hey guys,
I ran into this in a project I'm doing and made a quick fix:
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.
Is anyone making HTTParty speak the request format? For instance, build a XML string when requesting XML, etc?
from httparty.
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.
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.
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.
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.
Alright, nice work @d-snp! Maybe i will use your fork in my project then, thanks!
from httparty.
Related Issues (20)
- Curl logging issue HOT 1
- Add created? in docs HOT 2
- Issue with SOAP api starting from v0.18.0 HOT 4
- Please specify in documentation to convert body in json HOT 2
- read html response HOT 1
- 1:50: FATAL: Space required after the Public Identifier (Nokogiri::XML::SyntaxError) in ruby 3.0.3 HOT 1
- How to pass raw-data into post request using HTTParty HOT 2
- Feature - default headers HOT 1
- [BUG] HTTParty logger overrides Rails logger. HOT 2
- Configured timeout is duplicated HOT 4
- Question: Formatting an array of objects for multipart form-data
- Add application/problem+json to the supported formats HOT 1
- HTTParty response cache is broken HOT 1
- Is there a place to report security issues? HOT 1
- HTTParty.post is unusable HOT 12
- Bug in post function HOT 1
- HTTParty response body returning compressed GZipped data HOT 1
- Segmentation fault in request HOT 1
- Bundling Httparty results in ArgumentError: bad argument (expected URI object or URI string) HOT 1
- OpenSSL::SSL::SSLError HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from httparty.