Skip to content

Commit

Permalink
docs(http): FormData and other complex types do not work on Capacitor…
Browse files Browse the repository at this point in the history
…Http plugin methods on native platforms (#7132)

Co-authored-by: Chace Daniels <chaced12@gmail.com>
Co-authored-by: Dan Giralté <97970732+giralte-ionic@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 14, 2023
1 parent 3862d6e commit dfc97ee
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/src/core-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ export interface HttpOptions {
url: string;
method?: string;
params?: HttpParams;
/**
* Note: On Android and iOS, data can only be a string or a JSON.
* FormData, Blob, ArrayBuffer, and other complex types are only directly supported on web
* or through enabling `CapacitorHttp` in the config and using the patched `window.fetch` or `XMLHttpRequest`.
*
* If you need to send a complex type, you should serialize the data to base64
* and set the `headers["Content-Type"]` and `dataType` attributes accordingly.
*/
data?: any;
headers?: HttpHeaders;
/**
Expand Down

0 comments on commit dfc97ee

Please sign in to comment.