tink_http

Universal HTTP abstraction
http://haxetink.org/tink_http

To install, run:

haxelib install tink_http 0.7.1 

See using Haxelib in Haxelib documentation for more information.

README.md

Tink HTTP

Gitter

Client

// pick a client of your choice (see tink.http.Client)
var client:Client = ...;

// construct your request
var request:OutgoingRequest = ...;

client.request(request).handle(function(response) {
	// handle the response here
	trace(response);
});

Handler

Handler is just a function that takes in a request and return a future response.

typedef Handler = IncomingRequest->Future<OutgoingResponse>

Container

// prepare your handler
var handler:Handler = ...;

// pick a container of your choice (see tink.http.containers.*)
var container:Container = ...;

// start the container
container.run(handler).handle(function(result) switch result {
	case Running(running):
		// for persistent servers like NodeJS. Use running.shutdown() to shutdown the server.
	case Done;
		// for CGI-like environments like mod_neko or php
	case Failed(e):
		// something's wrong
});

Multipart

Todo...

Middleware

Todo...

Contributors
back2dos
Version
0.7.1
Published
2 months ago
License
MIT

All libraries are free

Every month, more than thousand developers use haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on Github!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on Github