Sha256: 41656c1f7d642b67837b62ee0c58f9d597e7d45c100d703c766e6de0914074e8

Contents?: true

Size: 364 Bytes

Versions: 1

Compression:

Stored size: 364 Bytes

Contents

class UnderOs::HTTP::Response
  attr_reader :data

  def initialize(response, data)
    @response = response
    @data     = data # raw NSData
  end

  def headers
    @response.allHeaderFields
  end

  def body
    @body ||= @data.to_s
  end

  def content_length
    headers["Content-Length"].to_i
  end

  def content_type
    headers["Content-Type"]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
under-os-1.0.0 lib/under_os/http/response.rb