[Bug 17242] Consider doing anonymous requests as a constructor argument rather than as a separate constructor

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17242

--- Comment #6 from Ojan Vafai <ojan@chromium.org> 2012-06-01 05:16:46 UTC ---
Hope I'm beating a dead horse since I know this has been discussed before, but
we could forego XHR entirely and just create a new class that doesn't have any
of the baggage where there are no invalid states that need errors thrown (only
invalid combinations of options, e.g. data + method=GET).

HttpRequest(url, options) or even just Request(url, options), in theory the
latter is future-compatible should we want to support protocols other than
http.

The only method it has is abort.

"options" allows the following properties: anonymous, on* (e.g. onloadstart,
etc), method, headers, asBinary, responseType, timeoutMS, withCredentials,
data. Should it have username/password? Obviously, no way to do sync requests.

An HttpRequest instance has the following properties: status, statusText,
response, responseHeaders.

headers/responseHeaders is a dictionary. I think the rest are self-explanatory.
Not really sure how the upload related stuff would fit in here. I suppose you
could have onupload* events on the options dictionary.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Friday, 1 June 2012 05:16:50 UTC