skip to Main Content

Jquery ajax – If an AJAX REST API succeeds or fails, how do I access the request headers within the success or error callbacks?

For example, I have: $.ajax({ type: 'POST', url: 'https://jsonplaceholder.typicode.com/todos', data: { name: 'random name' }, headers: { 'x-my-custom-header': 'XYZ' }, success: function(successResp) { console.log(successResp); }, error: function(errorResp){ console.log(errorResp); } }); How can I access 'x-my-custom-header' from the request header within success…

VIEW QUESTION

Redis – Nodejs loop event execution

Hello I am having problems with my setInterval it is only executing only once the if else checks below is my function const redis = require('redis'); const cache = redis.createClient(); require('./execSocket'); function teste(){ cache.dbsize(function(err,res){ if(res){ console.log(res); if(res > 10){ require('./execSql');…

VIEW QUESTION
Back To Top
Search