vadymmarkov / Malibu

:surfer: Malibu is a networking library built on promises
https://vadymmarkov.github.io
Other
414 stars 39 forks source link

Feature: custom response + validations #4

Closed vadymmarkov closed 8 years ago

vadymmarkov commented 8 years ago

@zenangst @RamonGilabert @onmyway133 Network request returns a custom Response type which is a subclass of Promise with some additional helper functions, for example validations. Right now you are able to validate status codes and content type:

networking.request(.GET, NSURL(string: "http://hyper.no")!)
  .validate(statusCodes: [200])
  .validate(contentTypes: ["application/json"])
zenangst commented 8 years ago

@vadymmarkov

brilliant