Function
post
(dataAPI: string, params?: object, headers?: object, otherProps?: object)
Source from the content-addressed store, hash-verified
| 32 | } |
| 33 | |
| 34 | export function post(dataAPI: string, params?: object, headers?: object, otherProps?: object): Promise<any> { |
| 35 | const fetchHeaders = { |
| 36 | Accept: 'application/json', |
| 37 | 'Content-Type': 'application/x-www-form-urlencoded', |
| 38 | ...headers, |
| 39 | }; |
| 40 | return request( |
| 41 | dataAPI, |
| 42 | 'POST', |
| 43 | fetchHeaders['Content-Type'].indexOf('application/json') > -1 || Array.isArray(params) |
| 44 | ? JSON.stringify(params) |
| 45 | : serialize(params), |
| 46 | fetchHeaders, |
| 47 | otherProps, |
| 48 | ); |
| 49 | } |
| 50 | |
| 51 | export function request( |
| 52 | dataAPI: string, |
Callers
nothing calls this directly
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…