mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
axios: allow transformRequest to take a list
This commit is contained in:
parent
98d3168c2c
commit
b84e715a3b
@ -16,3 +16,13 @@ axios<Repository>({
|
||||
method: HttpMethod[HttpMethod.GET],
|
||||
headers: {},
|
||||
}).then(r => console.log("ID:" + r.data.id + " Name: " + r.data.name));
|
||||
|
||||
axios.post("http://example.com/", {}, {
|
||||
transformRequest: (data: any) => data
|
||||
});
|
||||
|
||||
axios.post("http://example.com/", {}, {
|
||||
transformRequest: [
|
||||
(data: any) => data
|
||||
]
|
||||
});
|
||||
|
||||
2
axios/axios.d.ts
vendored
2
axios/axios.d.ts
vendored
@ -17,7 +17,7 @@ declare module Axios {
|
||||
* This is only applicable for request methods 'PUT', 'POST', and 'PATCH'
|
||||
* The last function in the array must return a string or an ArrayBuffer
|
||||
*/
|
||||
transformRequest?: <U>(data:T) => U;
|
||||
transformRequest?: (<U>(data:T) => U)|[<U>(data:T) => U];
|
||||
|
||||
/**
|
||||
* change the response data to be made before it is passed to then/catch
|
||||
|
||||
Loading…
Reference in New Issue
Block a user