Comments (1)
I can confirm this is necessary when using FakeWeb to stub requests from the RestClient gem (2.0.0+
).
Without inspecting this IO stream data, there's no way to see what was sent. Since FakeWeb.last_request.body
will be nil in the common case of sending a String payload with RestClient::Request.execute(...)
.
It is due to this code in RestClient::Request
creating a RestClient::Payload::Base
(or similar depending on the type of body data) and attaching it to the Net::HTTP
request body_stream
(rather than body
).
This was documented here as a performance improvement with the release of RestClient v2.0.0
Add actual support for streaming request payloads. Previously rest-client would call .to_s even on RestClient::Payload::Streamed objects. Instead, treat any object that responds to .read as a streaming payload and pass it through to .body_stream= on the Net:HTTP object. This massively reduces the memory required for large file uploads.
This isn't an issue with Net::HTTP
unless you're setting body_stream
directly on the request.
from fakeweb.
Related Issues (20)
- 1.3.0 does not recognize registered uri for post method
- FakeWeb stops @javascript (capybara & selenium) cukes from running. HOT 22
- Assigned but unused variable - uri in lib/fake_web/utility.rb:35
- using an https url HOT 2
- FakeWeb doesn't mimic Net::HTTP's check "#read_body called twice (IOError)"
- Different Responses to the same URI based on the passed data HOT 2
- "FakeWeb.allow_net_connect = true" doesn't work with PORO/ElasticSearch
- FakeWeb doesn't match non alphabetized query strings
- consider switching to Mocha 1.0 HOT 1
- please tag a new version and release a new gem HOT 4
- Unregister single URIs
- NetConnectNotAllowedError reports the URI different than what is acually being matched. HOT 3
- FakeWeb post method and check the request.body
- Too many connections error
- Release is desperately needed HOT 19
- Compatibility Issue with Ruby 2.4? HOT 2
- Test failures? HOT 4
- Regexp with query params fail without trailing slash after host
- Ruby 2 stops receiving security updates at the end of March
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 fakeweb.