Added more redirect codes.
Supports JSON posts.
Fixed auth bug which added a line break too much.