python's urllib.urlopen for javascript -


Is there a module written in Javascript which is equivalent to Python's urlib? Specifically, I want to do something like this:

  urllib.urlopen (url, data)   

which blocks an object that is blocking fetch Supports Alternatively, how can I block a server using Javascript in other ways?

You can use normal XMLHttpRequest synchronously:

  var xhr = New XMLHttpRequest (); Xhr.open ('post', url, incorrect); # Third is the ultimate sync / async xhr.send (data); Var response = xhr.responseText;    

Comments