AjaxConfig
interface
stable
Configuration for the ajax
creation function.
interface AjaxConfig { url: string body?: any async?: boolean method?: string headers?: Readonly<Record<string, any>> timeout?: number user?: string password?: string crossDomain?: boolean withCredentials?: boolean xsrfCookieName?: string xsrfHeaderName?: string responseType?: XMLHttpRequestResponseType createXHR?: () => XMLHttpRequest progressSubscriber?: PartialObserver<ProgressEvent> includeDownloadProgress?: boolean includeUploadProgress?: boolean queryParams?: string | URLSearchParams | Record<string, string | number | boolean | string[] | number[] | boolean[]> | [string, string | number | boolean | string[] | number[] | boolean[]][] }
Properties
Property | Type | Description |
---|---|---|
url
| string | The address of the resource to request via HTTP. |
body
| any | The body of the HTTP request to send. This is serialized, by default, based off of the value of the |
async
| boolean | Whether or not to send the request asynchronously. Defaults to |
method
| string | The HTTP Method to use for the request. Defaults to "GET". |
headers
| Readonly<Record<string, any>> | The HTTP headers to apply. Note that, by default, RxJS will add the following headers under certain conditions:
|
timeout
| number | The time to wait before causing the underlying XMLHttpRequest to timeout. This is only honored if the |
user
| string | The user credentials user name to send with the HTTP request |
password
| string | The user credentials password to send with the HTTP request |
crossDomain
| boolean | Whether or not to send the HTTP request as a CORS request. Defaults to |
withCredentials
| boolean | To send user credentials in a CORS request, set to Defaults to |
xsrfCookieName
| string | The name of your site's XSRF cookie. |
xsrfHeaderName
| string | The name of a custom header that you can use to send your XSRF cookie. |
responseType
| XMLHttpRequestResponseType | Can be set to change the response type. Valid values are Defaults to |
createXHR
| () => XMLHttpRequest | An optional factory used to create the XMLHttpRequest object used to make the AJAX request. This is useful in environments that lack If not provided, the NOTE: This AJAX implementation relies on the built-in serialization and setting of Content-Type headers that is provided by standards-compliant XMLHttpRequest implementations, be sure any implementation you use meets that standard. |
progressSubscriber
| PartialObserver<ProgressEvent> | An observer for watching the upload progress of an HTTP request. Will emit progress events, and completes on the final upload load event, will error for any XHR error or timeout. This will not error for errored status codes. Rather, it will always complete when the HTTP response comes back. |
includeDownloadProgress
| boolean | If If both this and |
includeUploadProgress
| boolean | If If both this and |
queryParams
| string | URLSearchParams | Record<string, string | number | boolean | string[] | number[] | boolean[]> | [string, string | number | boolean | string[] | number[] | boolean[]][] | Query string parameters to add to the URL in the request. This will require a polyfill for Accepts either a query string, a If, for some reason you have a query string in the |
© 2015–2021 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors.
Code licensed under an Apache-2.0 License. Documentation licensed under CC BY 4.0.
https://rxjs.dev/api/ajax/AjaxConfig