Comments (4)
This is fixed here: http://github.com/cap10morgan/httparty/compare/master...response_header_case_bug
from httparty.
Thanks for the patch. Generally, I'd love it if HTTParty::Response was more API-compatible with Net::HTTPResponse and this issue is bringing us a little closer to that. While your patch fixes the case-sensitivity issue we'd still be returning a simple hash instead something that acts more like an HTTPResponse object.
In this example, accessing the set-cookie header returns an array when it's accessed through HTTParty while Net::HTTP returns a comma delimited string.
>> r = HTTParty.get('http://github.com'); r.headers['set-cookie']
=> ["csrf_id=5bfd378ae7f1418ef00df0361b2cb5d7; path=/", "_github_ses=BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA%3D%3D--884981fc5aa85daf318eeff084d98e2cff92578f; path=/; expires=Wed, 01 Jan 2020 08:00:00 GMT; HttpOnly"]
>>
>> r = Net::HTTP.get_response(URI.parse('http://github.com')); r['set-cookie']
=> "csrf_id=bdceb42a51453f0f6f9ee8d2b5acd98a; path=/, _github_ses=BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA%3D%3D--884981fc5aa85daf318eeff084d98e2cff92578f; path=/; expires=Wed, 01 Jan 2020 08:00:00 GMT; HttpOnly"
I'm almost finished , just wanted to give you some context on why I'm moving towards another solution.
from httparty.
Sounds good to me. Thanks for the explanation.
from httparty.
Response headers accessible with mixed-case keys
HTTParty::Response#response now returns the Net::HTTPResponse object for
the request. Method missing now attempts to call the missing method on the
HTTPResponse object when it doesn't exist on the parsed response
object, i.e.
HTTParty.get('http://example.com').get_fields('content-type')
Closed by 179ef87
from httparty.
Related Issues (20)
- 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
- Is GHSA-5pq7-52mg-hr42 remotely exploitable?
- Adding Response Code Helper Methods like _401? HOT 2
- Add party foul mode HOT 1
- socks proxy only for special https links
- Preventing large payloads? HOT 3
- csv was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0 HOT 7
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.