Sha256: 469e64957fbf433e64959344eb6f67eab83720c883f888c8206fa48e18a18c08

Contents?: true

Size: 1.33 KB

Versions: 1

Compression:

Stored size: 1.33 KB

Contents

# For The Web

net/http is pretty much not good. dns behavior in ruby changes quite frequently.

Above all else, I want a consistent API and behavior that I can rely on. Ruby stdlib is not that thing.

I want:

* A HTTP client that acts as a full user agent, not just a single connections. (With connection reuse)
* HTTP and SPDY support.
* WebSockets support.
* SSL/TLS support.
* An API that lets me do what I need.
* Server and Client modes.
* Support for both normal operation and EventMachine would be nice.

## TODO

* Tests, yo.
* Logging, yo. With cabin, obviously.
* [DNS in Ruby stdlib is broken](https://github.com/jordansissel/experiments/tree/master/ruby/dns-resolving-bug), I need to write my own

## API Scratch

### Common case

    agent = FTW::Agent.new
    request = agent.get("http://www.google.com/")
    response = request.execute

    # Simpler
    response = agent.get!("http://www.google.com/")

### SPDY

    # SPDY should automatically be attempted. The caller should be unaware.

### WebSockets

    # 'http(s)' or 'ws(s)' urls are valid here. They will mean the same thing.
    request = agent.websocket("http://somehost/endpoint")
    # Set auth header
    request["Authorization"] = ...
    request["Cookie"] = ...

    websocket, error = request.execute
    # Now websocket.read receives a message, websocket.write sends a message.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ftw-0.0.4 README.md