Sha256: 3ba95a7fcbf03a8aa8ae0b4e808bedae35af0ace1c4f09322b347d5d467e2dec

Contents?: true

Size: 896 Bytes

Versions: 11

Compression:

Stored size: 896 Bytes

Contents

# frozen_string_literal: true

module Aws
  module Crt
    # High level Ruby abstractions for CRT HTTP functionality
    module Http
      # HTTP Headers
      class Headers
        include Aws::Crt::ManagedNative
        native_destroy Aws::Crt::Native.method(
          :http_headers_release
        )

        def initialize(headers = {})
          blob = StringBlob.encode(headers.flatten)
          blob_ptr = FFI::MemoryPointer.new(:char, blob.length)
          blob_ptr.write_array_of_char(blob)

          manage_native do
            Aws::Crt::Native.http_headers_new_from_blob(blob_ptr, blob.length)
          end
        end

        def to_blob_strings
          buf_out = Aws::Crt::Native::CrtBuf.new
          Aws::Crt::Native.http_headers_to_blob(native, buf_out)
          StringBlob.decode(buf_out.to_blob)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
aws-crt-0.4.0-x64-mingw32 lib/aws-crt/http/headers.rb
aws-crt-0.3.0-x64-mingw32 lib/aws-crt/http/headers.rb
aws-crt-0.2.1-x64-mingw32 lib/aws-crt/http/headers.rb
aws-crt-0.2.0-x64-mingw32 lib/aws-crt/http/headers.rb
aws-crt-0.1.9-x64-mingw32 lib/aws-crt/http/headers.rb
aws-crt-0.1.8-x64-mingw32 lib/aws-crt/http/headers.rb
aws-crt-0.1.7-x64-mingw32 lib/aws-crt/http/headers.rb
aws-crt-0.1.6-x64-mingw32 lib/aws-crt/http/headers.rb
aws-crt-0.1.5-x64-mingw32 lib/aws-crt/http/headers.rb
aws-crt-0.1.4-x64-mingw32 lib/aws-crt/http/headers.rb
aws-crt-0.1.2-x86_64-mingw32 lib/aws-crt/http/headers.rb