Skip to content

Commit

Permalink
Corrections on XHR binary upload support
Browse files Browse the repository at this point in the history
  • Loading branch information
peterflynn committed Apr 3, 2019
1 parent 6672c23 commit c7fe26c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Inline `style` attributes now work when used with `innerHTML` and friends.
* Pseudo-class `:focus`
* Pseudo-class `:lang()`
* **Send `FormData` in XHR**
* **Send `FormData` with XHR** -- This provides an easy way to post data to an endpoint expecting `multipart/form-data`. (But uploading binary files with Blob is not supported yet -- use ArrayBuffer).
* **requestAnimationFrame() for UI** -- Complimenting the earlier addition of `setTimeout()` APIs, this new global API makes it easier to use certain UI libraries such as "react-virtualized" with
fewer polyfills. These APIs _do not_ allow plugins to control animations in the XD document -- plugins can still only modify the document as part of an atomic operation while the UI is blocked.
But this API does allow for simple animations in your plugin's dialog UI (e.g. a progress indicator).
Expand Down
1 change: 1 addition & 0 deletions known-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@

- On macOS, it is not possible to use self-signed certificates with secure Websockets.
- Websockets do not support extensions.
- XHR can only send binary content using an ArrayBuffer -- Blob is not supported.
- XHR does not support cookies.
- `responseURL` is not supported on XHR

Expand Down
2 changes: 1 addition & 1 deletion reference/uxp/class/XMLHttpRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,5 +260,5 @@ Sends the request. If the request is asynchronous (which is the default), this m

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| [data] | `\*` | <code></code> | A body of data to be sent in the XHR request. This can be: A Document, in which case it is serialized before being sent. A BodyInit, which as per the Fetch spec can be a Blob, BufferSource, FormData, URLSearchParams, ReadableStream, or USVString object. If no value is specified for the body, a default value of null is used. The best way to send binary content (e.g. in file uploads) is by using an ArrayBufferView or Blob in conjunction with the send() method. |
| [data] | `\*` | <code></code> | A body of data to be sent in the XHR request. This can be: A Document, in which case it is serialized before being sent. A BodyInit, which can be a BufferSource, FormData (without nested files/Blobs), URLSearchParams, ReadableStream, or USVString object. If no value is specified for the body, a default value of null is used. <br><br>To send binary content (e.g. in file uploads), use an ArrayBufferView in conjunction with the send() method. **Note:** Sending binary data via Blob is not supported yet. |

5 changes: 2 additions & 3 deletions reference/uxp/network-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ Most of the XHR API surface is supported, including:
* Event handling
* Sending text and binary data
* Text is expected to be UTF8 encoded.
* Binary data uses `ArrayBuffer`, not blobs
* Sending binary data is not currently supported (but coming)
* Binary data must use `ArrayBuffer`, not `Blob`

Unsupported portions of the surface:

* `responseURL`
* Sending / receiving blobs is not supported
* Sending / receiving Blobs is not supported
* Synchronous XHR will throw an error


Expand Down

0 comments on commit c7fe26c

Please sign in to comment.