You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
424 B
15 lines
424 B
|
3 years ago
|
//hap adapter
|
||
|
|
module.exports = function (fetch) {
|
||
|
|
return function (request, responseCallback) {
|
||
|
|
request.data = request.body;
|
||
|
|
request.header = request.headers;
|
||
|
|
request.complete = (ret) => {
|
||
|
|
responseCallback({
|
||
|
|
statusCode: ret.code,
|
||
|
|
responseText: ret.data,
|
||
|
|
headers: ret.headers
|
||
|
|
})
|
||
|
|
}
|
||
|
|
fetch.fetch(request)
|
||
|
|
}
|
||
|
|
}
|