Questions tagged [xmlhttprequest]

14 questions
33
votes
2 answers

Why does XMLHttpRequest not seem to follow a naming convention?

I've been working with the XMLHttpRequest object in JavaScript recently, and I couldn't help but notice that the casing of this name makes no sense. Why is 'XML' all in caps while 'Http' is not? They're both acronyms! Surely it'd make more sense…
Alec
  • 441
  • 4
  • 5
30
votes
5 answers

How do web servers enforce the same-origin policy?

I'm diving deeper into developing RESTful APIs and have so far worked with a few different frameworks to achieve this. Of course I've run into the same-origin policy, and now I'm wondering how web servers (rather than web browsers) enforce it. From…
rgb
  • 879
  • 2
  • 8
  • 18
9
votes
1 answer

Who first created or popularized the original XMLHTTPRequest / MSXML?

I'm trying to understand the origins of AJAX, and think MSXML and XMLHTTPRequest were the objects that started it all. Which came first, and/or became the defacto way to create dynamic pages?
makerofthings7
  • 6,038
  • 4
  • 39
  • 77
3
votes
2 answers

Should we (still) consider a synced XMLHTTPRequest bad practice?

As you may know, XMLHTTPRequest can be used synchronously or asynchronously, but synchronized requests have always been considered bad practice, and I've always agreed with that. Not only is the ideology of modern JS development heavily based on an…
shabunc
  • 2,424
  • 2
  • 20
  • 27
2
votes
1 answer

What is the middleware (if any) in web-service consumed by a website?

I am trying to identify the parts of an architecture. The server (Python) acts as a web-service, delivering files and data. The client (JS) requests the data which it needs by sending xmlhttprequests to the server. I read that there can be a…
null
  • 3,546
  • 1
  • 11
  • 21
1
vote
2 answers

Video streaming through Ajax calls

These days I have seen couple of sites (including Youtube) that stream videos through Ajax calls (XHR) in few MBs or even less than MB. For an example of what I said see the highlighted lines in the image below. I want to know: What this…
Khadim Ali
  • 153
  • 1
  • 7
1
vote
1 answer

Will simply adding a 'Allow Cross Origin Requests' to my node app work?

I'm trying to make a 'frontend web scraper'. I had the idea of setting up a node app that had a dynamic route that used Request (the NPM package) to scrape pages and displayed them as it's own. Then my JS plugin would add an invisible iframe to…
0
votes
2 answers

Making an HTTP request for a response without a layout

I'm making an application where the front-end can display resources both as themselves or within a modal. Of course, when the server gets a request for a resource in HTML, it's going to include a layout (with a , maybe a header and footer in…
Jonathan Allard
  • 215
  • 1
  • 6
0
votes
1 answer

How to POST CSV with XMLHttpRequest

I would like to send a CSV file via POST in a XMLHttpRequest, but I am unsure of two things. First is there anything to distinguish a CSV file from a string split up by comma's? And what sort of Content-Type am I supposed to put in to the…
EasilyBaffled
  • 399
  • 2
  • 5
  • 11
0
votes
1 answer

How to use specific Request Header

I am learning how to work with XMLHttpRequests. I know that request.setRequestHeader() is an important factor. I just don't understand why. It took me a while but I have at least found a list of Headers here and here, but I still don't understand…
EasilyBaffled
  • 399
  • 2
  • 5
  • 11
0
votes
1 answer

Is sending data to a server via a script tag an outdated paradigm?

I inherited some old javascript code for a website tracker that submits data to the server using a script url: var src = "http://domain.zzz/log/method?value1=x&value2=x" var e = document.createElement('script'); e.src = src; I…
0
votes
1 answer

HTTP resource bundling/streaming practice

Our SPA (plain HTML and Javascript) makes use of huge volume of javascript and other resources that are downloaded via XHR. Given the sheer number of components and browser simultaneous request limits, we're thinking for ways to deliver our…
icelava
  • 171
  • 11
0
votes
1 answer

Security comparison between xmlHttpRequest and HttpRequest

Is there a difference between HttpRequest and xmlHttpRequest in terms of security? Is one more secure than the other? Is it more secure to send important data such as passwords via HttpRequest than via xmlHttpRequest ? Is data packing in both done…
msoa
  • 149
  • 1
  • 3
-2
votes
2 answers

Why does an POST request from HTML/JavaScript generates 401(unauthorized) but it doesn't from a C program?

I have to send a POST request with some data to a RESTful API. Right now I have a C program that creates a socket, connects with the host and successfully sends the POST request. After some C magic, the request is formed as follows: POST…
m4l490n
  • 117
  • 6