Class: Http2::GetRequest

Inherits:
BaseRequest show all
Defined in:
lib/http2/get_request.rb

Constant Summary

Constants inherited from BaseRequest

BaseRequest::VALID_ARGUMENTS_POST

Instance Attribute Summary

Attributes inherited from BaseRequest

#args, #debug, #http2

Instance Method Summary collapse

Methods inherited from BaseRequest

#initialize, #path

Constructor Details

This class inherits a constructor from Http2::BaseRequest

Instance Method Details

#executeObject



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/http2/get_request.rb', line 2

def execute
  @http2.mutex.synchronize do
    @http2.connection.write(headers_string)

    puts "Http2: Reading response." if @debug
    resp = @http2.read_response(self, @args)

    puts "Http2: Done with get request." if @debug
    return resp
  end
end

#headers_stringObject



14
15
16
17
18
19
20
21
22
# File 'lib/http2/get_request.rb', line 14

def headers_string
  unless @header_str
    @header_str = "#{method} /#{@args[:url]} HTTP/1.1#{@nl}"
    @header_str << @http2.header_str(@http2.default_headers(@args))
    @header_str << @nl
  end

  @header_str
end