Function
postJson
(
target: TargetShape,
identity: Identity,
path: string,
body?: unknown,
expectedStatus = 200,
)
Source from the content-addressed store, hash-verified
| 177 | }; |
| 178 | |
| 179 | const postJson = <T>( |
| 180 | target: TargetShape, |
| 181 | identity: Identity, |
| 182 | path: string, |
| 183 | body?: unknown, |
| 184 | expectedStatus = 200, |
| 185 | ): Promise<{ readonly body: T; readonly text: string }> => |
| 186 | request<T>( |
| 187 | target, |
| 188 | identity, |
| 189 | path, |
| 190 | { |
| 191 | method: "POST", |
| 192 | ...(body !== undefined ? { body: JSON.stringify(body) } : {}), |
| 193 | }, |
| 194 | expectedStatus, |
| 195 | ); |
| 196 | |
| 197 | const deletePath = ( |
| 198 | target: TargetShape, |
Tested by
no test coverage detected