Wraps hapi wreck inside Bluebird promise and with interceptor for tracing the request and response.
import wreck from 'wreck-promisify'
wreck.get(url [, options]).then(response => {
// ... handle response
})
wreck.put(url [, options]).then(response => {
// ... handle response
})
wreck.post(url [, options]).then(response => {
// ... handle response
})
wreck.delete(url [, options]).then(response => {
// ... handle response
})
Options are passed to wreck as is. See Wreck documentation for more info.
Response interface is an object with following fields:
- body - Response body as a string
- headers - Response headers
- statusCode - Response status code
- statusMessage - Response status message