Class: Net::HTTP
- Inherits:
-
Object
- Object
- Net::HTTP
- Defined in:
- lib/deltacloud/helpers/blob_stream_helper.rb
Defined Under Namespace
Classes: Put
Instance Method Summary collapse
- #end_request ⇒ Object
- #request(req, body = nil, blob_stream = nil, &block) ⇒ Object
- #request_orig ⇒ Object
Instance Method Details
#end_request ⇒ Object
169 170 171 172 173 174 175 176 177 178 |
# File 'lib/deltacloud/helpers/blob_stream_helper.rb', line 169 def end_request begin res = HTTPResponse.read_new(@socket) end while res.kind_of?(HTTPContinue) res.reading_body(@socket, @blob_req.response_body_permitted?) { yield res if block_given? } end_transport @blob_req, res do_finish res end |
#request(req, body = nil, blob_stream = nil, &block) ⇒ Object
150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/deltacloud/helpers/blob_stream_helper.rb', line 150 def request(req, body = nil, blob_stream = nil, &block) unless blob_stream return request_orig(req, body, &block) end @blob_req = req do_start #start the connection req.set_body_internal body begin_transport req req.write_header_m @socket,@curr_http_version, edit_path(req.path) @socket end |
#request_orig ⇒ Object
148 |
# File 'lib/deltacloud/helpers/blob_stream_helper.rb', line 148 alias :request_orig :request |