make http compatible with $.ajax