--- !ruby/object:RI::ClassDescription 
attributes: 
- !ruby/object:RI::Attribute 
  comment: 
  name: cookies
  rw: RW
- !ruby/object:RI::Attribute 
  comment: 
  name: host
  rw: R
- !ruby/object:RI::Attribute 
  comment: 
  name: path
  rw: RW
- !ruby/object:RI::Attribute 
  comment: 
  name: port
  rw: R
- !ruby/object:RI::Attribute 
  comment: 
  name: request_headers
  rw: RW
- !ruby/object:RI::Attribute 
  comment: 
  name: response_headers
  rw: RW
class_methods: 
- !ruby/object:RI::MethodSummary 
  name: new
comment: 
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Synopsis
- !ruby/struct:SM::Flow::P 
  body: ThinHTTP is a light-weight and user friendly HTTP library. This class is useful for sending simple GET requests or uploading files via POST.
- !ruby/struct:SM::Flow::P 
  body: By default, it sends URL encoded data (application/x-www-form-urlencoded). MIME multipart encoded data (multipart/form-data) can be sent by utilizing the MIME library or the MultipartFormData class.
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Features
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Implements GET and POST requests.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Follows redirects using GET requests and set instance's host, port, and path attributes using the final destination URI.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Accepts either a params hash or an encoded string for POST and GET requests.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: User-defined headers are sent with each request.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Sends and receives cookies automatically.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: HTTP support only (HTTPS will be implemented when needed).
  type: :BULLET
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Design Goals
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Extremely simple implementation and easy to use interface.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Only implement what is absolutely necessary.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Adhere to the RFCs.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Utilize third party libraries for added functionality when appropriate (i.e. MIME library for constructing multipart/form-data POSTs).
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Build lightly on top of the standard Net::HTTP library.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Useful as a test tool in unit and integration testing (original design goal).
  type: :BULLET
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Examples
- !ruby/struct:SM::Flow::H 
  level: 3
  text: GET Request
- !ruby/struct:SM::Flow::VERB 
  body: "  th = ThinHTTP.new('rubyforge.org', 80)\n  th.set_header('User-Agent', th.class.to_s)\n  response = th.get('/')\n"
- !ruby/struct:SM::Flow::H 
  level: 3
  text: POST Request (URL encoding)
- !ruby/struct:SM::Flow::VERB 
  body: "  th = ThinHTTP.new('example.com')\n  response = th.post('/submit_form', :param1 =&gt; 'val1', :param2 =&gt; 'val2')\n"
- !ruby/struct:SM::Flow::H 
  level: 3
  text: POST Request (multipart/form-data encoding using MIME library)
- !ruby/struct:SM::Flow::VERB 
  body: "  fd = MIME::MultipartMedia::FormData.new\n  fd.add_entity(MIME::TextMedia.new('Clint'), 'first_name')\n  fd.add_entity(MIME::DiscreteMediaFactory.create('/tmp/pic.jpg'), 'portrait')\n\n  th = ThinHTTP.new('example.com')\n  response = th.post('/upload_file', fd.body, fd.content_type)\n"
- !ruby/struct:SM::Flow::H 
  level: 2
  text: More Examples
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Check the MultipartFormData class examples
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Check the ThinHTTPTest class source code
  type: :BULLET
constants: []

full_name: ThinHTTP
includes: []

instance_methods: 
- !ruby/object:RI::MethodSummary 
  name: get
- !ruby/object:RI::MethodSummary 
  name: host=
- !ruby/object:RI::MethodSummary 
  name: port=
- !ruby/object:RI::MethodSummary 
  name: post
- !ruby/object:RI::MethodSummary 
  name: set_header
- !ruby/object:RI::MethodSummary 
  name: unset_header
name: ThinHTTP
superclass: Object
