Dont send headers manually, http-client automatically will

This commit is contained in:
David Kale 2020-02-04 15:40:55 -05:00
parent f726af703b
commit ac9a0a0a78

View file

@ -133,13 +133,9 @@ export async function reserveCache(key: string): Promise<number> {
const reserveCacheRequest: ReserveCacheRequest = {
key
};
const additionalHeaders = {
"Content-Type": "application/json"
};
const response = await httpClient.postJson<ReserveCacheResponse>(
getCacheApiUrl("caches"),
reserveCacheRequest,
additionalHeaders
reserveCacheRequest
);
return response?.result?.cacheId ?? -1;
}
@ -269,13 +265,9 @@ async function commitCache(
filesize: number
): Promise<ITypedResponse<null>> {
const commitCacheRequest: CommitCacheRequest = { size: filesize };
const additionalHeaders = {
"Content-Type": "application/json"
};
return await httpClient.postJson<null>(
getCacheApiUrl(`caches/${cacheId.toString()}`),
commitCacheRequest,
additionalHeaders
commitCacheRequest
);
}