198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
# File 'lib/appengine-apis/urlfetch.rb', line 198
def request(req, body=nil, &block)
begin
proto = use_ssl? ? 'https' : 'http'
url = "#{proto}://#{addr_port}#{req.path}"
options = {
:payload => body || req.body,
:follow_redirects => false,
:allow_truncated => true,
:method => req.method,
:headers => req
}
res = AppEngine::URLFetch.fetch(url, options)
end while res.kind_of?(Net::HTTPContinue)
res.reading_body(nil, req.response_body_permitted?) {
yield res if block_given?
}
return res
end
|