Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function needleObservable(path: string, originalRequest: functions.Request, body: any): Observable<void | NeedleResponse> {
- const options: NeedleOptions = {
- headers: {
- date: originalRequest.headers.date,
- authorization: originalRequest.headers.authorization
- },
- rejectUnauthorized: false,
- json: false,
- content_type: originalRequest.headers["content-type"],
- connection: 'close'
- };
- return observableFrom(
- needle('post', SERVER_PREFIX + path, body, options)
- .then(function(resp) {
- return resp;
- })
- .catch(function(err) {
- console.log('Caught error')
- console.error(err);
- })
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement