Class: Thrift::HTTPClientTransport

### Home Classes Methods

### In Files

- lib/thrift/transport/http_client_transport.rb

### Parent

Thrift::BaseTransport

### Methods

- ::new
- #add_headers
- #flush
- #open?
- #read
- #write

### Files

- CHANGELOG
- README
- Makefile

### Class/Module Index

Quicksearch

- Thrift
- Thrift::ApplicationException
- Thrift::BaseProtocol
- Thrift::BaseProtocolFactory
- Thrift::BaseServer
- Thrift::BaseServerTransport
- Thrift::BaseTransport
- Thrift::BaseTransportFactory
- Thrift::BinaryProtocol
- Thrift::BinaryProtocolAcceleratedFactory
- Thrift::BinaryProtocolFactory
- Thrift::BufferedTransport
- Thrift::BufferedTransportFactory
- Thrift::Client
- Thrift::CompactProtocol
- Thrift::CompactProtocol::CompactTypes
- Thrift::CompactProtocolFactory
- Thrift::Deserializer
- Thrift::Exception
- Thrift::FramedTransport
- Thrift::FramedTransportFactory
- Thrift::HTTPClientTransport
- Thrift::IOStreamTransport
- Thrift::MemoryBufferTransport
- Thrift::MessageTypes
- Thrift::MongrelHTTPServer
- Thrift::MongrelHTTPServer::Handler
- Thrift::NonblockingServer
- Thrift::Processor
- Thrift::ProtocolException
- Thrift::Serializer
- Thrift::ServerSocket
- Thrift::SimpleServer
- Thrift::Socket
- Thrift::Struct
- Thrift::Struct_Union
- Thrift::ThreadPoolServer
- Thrift::ThreadedServer
- Thrift::TransportException
- Thrift::TransportUtils
- Thrift::TypeError
- Thrift::Types
- Thrift::UNIXServerSocket
- Thrift::UNIXSocket
- Thrift::Union
- Fixnum

No matching classes.

# Thrift::HTTPClientTransport

### Public Class Methods

new(url) click to toggle source

    # File lib/thrift/transport/http_client_transport.rb, line 28
    def initialize(url)
      @url = URI url
      @headers = {'Content-Type' => 'application/x-thrift'}
      @outbuf = ""
    end

### Public Instance Methods

add_headers(headers) click to toggle source

    # File lib/thrift/transport/http_client_transport.rb, line 38
    def add_headers(headers)
      @headers = @headers.merge(headers)
    end

flush() click to toggle source

    # File lib/thrift/transport/http_client_transport.rb, line 42
    def flush
      http = Net::HTTP.new @url.host, @url.port
      http.use_ssl = @url.scheme == "https"
      resp, data = http.post(@url.request_uri, @outbuf, @headers)
      @inbuf = StringIO.new data
      @outbuf = ""
    end

open?() click to toggle source

    # File lib/thrift/transport/http_client_transport.rb, line 34
    def open?; true end

read(sz) click to toggle source

    # File lib/thrift/transport/http_client_transport.rb, line 35
    def read(sz); @inbuf.read sz end

write(buf) click to toggle source

    # File lib/thrift/transport/http_client_transport.rb, line 36
    def write(buf); @outbuf << buf end

[Validate]

Generated with the Darkfish Rdoc Generator 2.