(dataAPI: any, params = {}, headers: any = {}, otherProps = {})
| 48 | * @returns |
| 49 | */ |
| 50 | export function post(dataAPI: any, params = {}, headers: any = {}, otherProps = {}) { |
| 51 | const processedHeaders = { |
| 52 | Accept: 'application/json', |
| 53 | 'Content-Type': 'application/x-www-form-urlencoded', |
| 54 | ...headers, |
| 55 | }; |
| 56 | const body = processedHeaders['Content-Type'].indexOf('application/json') > -1 || Array.isArray(params) |
| 57 | ? JSON.stringify(params) |
| 58 | : serializeParams(params); |
| 59 | |
| 60 | return request( |
| 61 | dataAPI, |
| 62 | 'POST', |
| 63 | body, |
| 64 | processedHeaders, |
| 65 | otherProps, |
| 66 | ); |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * do request |
no test coverage detected
searching dependent graphs…