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