xetorthio / shmock

Simple HTTP Mocking Library
MIT License
101 stars 20 forks source link

Add support for setting response headers #13

Closed marcosnils closed 9 years ago

marcosnils commented 9 years ago

API was taken from the same way nock does it (https://github.com/pgte/nock#specifying-reply-headers)

tinchogob commented 9 years ago

+1! Could you also update the Readme?

marcosnils commented 9 years ago

@tinchogob done.

xetorthio commented 9 years ago

How about we also make reply similar to the request? So it is nestable and offers a nicer API. For example you could do:

mock.get('/foo').set('Authorization', '123456').reply(401).set('WWW-Authenticate', 'Basic realm=foobar');