Skip to content

Missing XMLHTTPRequest.response property in "dart:html" #1773

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
DartBot opened this issue Feb 20, 2012 · 13 comments
Closed

Missing XMLHTTPRequest.response property in "dart:html" #1773

DartBot opened this issue Feb 20, 2012 · 13 comments

Comments

@DartBot
Copy link

DartBot commented Feb 20, 2012

This issue was originally filed by kva...@gmail.com


What steps will reproduce the problem?
Currently XMLHTTPRequest provides the "responseType" setter and getter, but there is no way to get "ArrayBuffer" type as a response, because "response" property is not there. At the same time it works in "dart:dom".

What is the expected output? What do you see instead?
A call to missing method causes JS exception.

What version of the product are you using? On what operating system?
Dart SDK binaries rev 4373, Mac OS 10.7

@sethladd
Copy link
Contributor

Added Area-UI, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Feb 23, 2012

This comment was originally written by kvar...@gmail.com


This issue is critical for my project (http://kri-web.googlecode.com), as I need to load external resources to work (reverting back to dark:dom doesn't sound as a good idea).

@DartBot
Copy link
Author

DartBot commented Mar 8, 2012

This comment was originally written by @pjako


I tried to do it in dart:dom: XMLHttpRequestImplementation

Parse Binary
arraybuffer
Exception: NotImplementedException
Stack Trace: 0. Function: 'XMLHttpRequestImplementation.get:response' url: '/b/build/slave/dartium-mac-full/build/src/xcodebuild/DerivedSources/Release/webkit/bindings/dart/generated/dart/XMLHttpRequestImplementation.dart' line:20 col:3
 1. Function: 'Model.function' url: 'http://0.0.0.0:3030/Users/work4/dart/DartEngine/model.dart' line:195 col:36

@DartBot
Copy link
Author

DartBot commented Mar 8, 2012

This comment was originally written by kvarkus...@gmail.com


You need to set the response time prior to sending the request:
req.responseType = 'arraybuffer';

@DartBot
Copy link
Author

DartBot commented Mar 13, 2012

This comment was originally written by @pjako


 Shure I did that:

dom.XMLHttpRequest reqVert = new dom.XMLHttpRequest();
    reqVert.open("GET",url,true);
    reqVert.responseType = "arraybuffer";
    
    reqVert.addEventListener("load", (e) {
      _parseBinary(reqVert.response);
      
    } );
    reqVert.send("");

@DartBot
Copy link
Author

DartBot commented Mar 14, 2012

This comment was originally written by kva...@gmail.com


Then your browser doesn't like it. Chromium accepted response property just fine.
Anyway, the documentation on dart:dom lists it among properties:
http://api.dartlang.org/dom/XMLHttpRequest.html

@DartBot
Copy link
Author

DartBot commented Mar 15, 2012

This comment was originally written by @pjako


Ah okay, I only tested it in dartium so far

@vsmenon
Copy link
Member

vsmenon commented Apr 13, 2012

Removed Area-UI label.
Added Area-DOM label.

@DartBot
Copy link
Author

DartBot commented Apr 27, 2012

This comment was originally written by batista.ma...@gmail.com


I'm doing the same thing in Chromium 20.0.1116.0 and the response attribute for the DOM XMLHttpRequest cannot be accessed here as well. Any progress solving this?

@DartBot
Copy link
Author

DartBot commented Apr 27, 2012

This comment was originally written by batista.ma...@gmail.com


here's my code and the error message below

class Sound {
  
  DOM.AudioBuffer buffer;
  String source;
  
  Sound(String this.source)
  {
    loadSound(source);
  }
  
  void loadSound(String url)
  {
    DOM.XMLHttpRequest request = new DOM.XMLHttpRequest();
    request.open('GET', url, true);
    request.responseType = 'arraybuffer';
 
    request.addEventListener('load', onLoaded);
    
    request.send();
  }
  
  
  void onLoaded(DOM.XMLHttpRequestProgressEvent e)
  {
    DOM.XMLHttpRequest request = e.currentTarget;
    SoundManager manager = new SoundManager();
    manager.onSoundLoaded(request.response);
  }
  
}

Exception: UnsupportedOperationException: [info: ..\bindings\dart\custom\DartXMLHttpRequestCustom.cpp:223]
Stack Trace: 0. Function: 'XMLHttpRequestImplementation.get:response' url: 'e:\b\build\slave\dartium-win-inc\build\src\build\Release\obj\global_intermediate\webkit\bindings\dart\dart\XMLHttpRequestImplementation.dart'

@alextekartik
Copy link

As I was testing bug 1432, this sounds like fixed to me as of build 7323. "response" is now implemented in XMLHttpRequest

@DartBot
Copy link
Author

DartBot commented May 5, 2012

This comment was originally written by batista.marce...@gmail.com


Yes it's fixed for a while now!! Works just fine ;)

@vsmenon
Copy link
Member

vsmenon commented Jul 11, 2012

Added Fixed label.

copybara-service bot pushed a commit that referenced this issue Nov 3, 2022
…t, test_process, webdev

Revisions updated by `dart tools/rev_sdk_deps.dart`.

browser_launcher (https://github.com/dart-lang/browser_launcher/compare/981ca88..5fa0bd6):
  5fa0bd6  2022-11-01  Kevin Moore  Update lints, require Dart 2.17, add dependabot (#34)

dartdoc (https://github.com/dart-lang/dartdoc/compare/3273437..179ada0):
  179ada02  2022-11-02  Sam Rawlins  Change _HashableChildLibraryElementVisitor to be a RecursiveElementVisitor (#3242)
  a6e7d908  2022-11-02  Sam Rawlins  Make Inheritable.isOverride late final non-nullable (#3235)
  c4f52cf9  2022-11-02  Sam Rawlins  Test records support in typedefs (#3239)
  f74e129f  2022-11-02  Sam Rawlins  Make Accessor.documentationComment late final non-nullable (#3240)
  ad50bfbc  2022-10-31  dependabot[bot]  Bump github/codeql-action from 2.1.28 to 2.1.29 (#3238)

http (https://github.com/dart-lang/http/compare/738a55b..6339026):
  6339026  2022-11-02  Brian Quinlan  Make timeout and cache controllable per-request. (#815)
  51dbca2  2022-10-31  Brian Quinlan  Add a streaming request example. (#813)

mime (https://github.com/dart-lang/mime/compare/bf041aa..d80f4d0):
  d80f4d0  2022-11-02  Liu YuanYuan  Add .avif to extension map (#70)
  3a6b14e  2022-11-01  dependabot[bot]  Bump actions/checkout from 3.0.2 to 3.1.0 (#72)

string_scanner (https://github.com/dart-lang/string_scanner/compare/10435a4..4a5cbc5):
  4a5cbc5  2022-10-31  Kevin Moore  Make code in readme consistent with example (#49)

test (https://github.com/dart-lang/test/compare/b82fc0b..173a36f):
  173a36f2  2022-11-01  Jacob MacDonald  prep packages to publish (#1780)
  fd8e2b68  2022-10-31  Devon Carew  fix an issue with the github reporter (#1779)

test_process (https://github.com/dart-lang/test_process/compare/068f9f8..1774aa7):
  1774aa7  2022-11-01  dependabot[bot]  Bump actions/checkout from 3.0.2 to 3.1.0 (#36)

webdev (https://github.com/dart-lang/webdev/compare/c350055..069b870):
  069b870  2022-11-01  Elliott Brooks (she/her)  Prepare webdev for release to v.2.7.12 (#1775)
  cb06447  2022-11-01  Elliott Brooks (she/her)  Prep DWDS for release (#1774)
  daa154d  2022-11-01  Elliott Brooks (she/her)  Reset MV3 extension to nice starting point (#1773)
  98a6142  2022-11-01  Jakub Vrána  Remove // ignore: unsafe_html. (#1759)
  939e285  2022-10-31  Elliott Brooks (she/her)  Update documentation for Webdev release process (#1771)
  0428ffb  2022-10-31  Elliott Brooks (she/her)  Update package:file to latest version (#1770)

Change-Id: I5020d718f6c009bca4f9b5e69232dc425b9d3409
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267761
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
This issue was closed.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants