Class: Http2::PostRequest

Inherits:
BaseRequest show all
Defined in:
lib/http2/post_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



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

def execute
  @data = raw_data

  @http2.mutex.synchronize do
    puts "Http2: Doing post." if @debug

    @conn.write(headers_string)
    return @http2.read_response(self, @args)
  end
end

#headers_stringObject



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

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

  @headers_string
end