Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- router.get('/getJokesJson', function(request, response){
- httpRequest({
- headers: {
- 'Accept': 'text/plain'
- },
- uri: 'https://icanhazdadjoke.com/',
- method: 'GET'
- }, function (error, httpResponse, body) {
- //httpResponse.set('Content-Type', 'text/plain');
- console.log('error:', error); // Print the error if one occurred and handle it
- console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
- console.log(body);
- return response.send(body);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement