class MIME::Content::Application::Http

For application/http . Content is either a Request or a Response

Constants

HEADER_RGX
HTTP_MTHS_RGX
HTTP_RESP_RGX
HTTP_R_RGX

Public Class Methods

new() click to toggle source
# File lib/safrano/multipart.rb, line 553
def initialize
  @hd = {}
  @ct = 'application/http'
  @parser = Parser.new(self)
end

Public Instance Methods

==(other) click to toggle source
# File lib/safrano/multipart.rb, line 559
def ==(other)
  @content = other.content
end
get_response(batchapp) click to toggle source
# File lib/safrano/multipart.rb, line 563
def get_response(batchapp)
  # self.content should be the request
  rack_resp = batchapp.batch_call(@content)
  @response = MIME::Content::Application::HttpResp.new
  @response.status = rack_resp[0]
  @response.hd = rack_resp[1]
  @response.content = rack_resp[2]
  @response
end
unparse() click to toggle source
# File lib/safrano/multipart.rb, line 573
def unparse
  b =  +"Content-Type: #{@ct}#{CRLF}"
  b << "Content-Transfer-Encoding: binary#{CRLF}#{CRLF}"
  b << @content.unparse
  b
end