algorand / algorand/js-algorand-sdk

POST and DELETE requests always assume the response is JSON

Open
#751 2 comments 0 reactions 0 assignees View on GitHub
Team Lamprey
Dominant language
TypeScript
Stars
297
Forks
214
Avg merge
1h 3m
Merged PRs (30d)
3

Description

## Problem

Our [POST](https://github.com/algorand/js-algorand-sdk/blob/0039284f1ecf77b609acab9da3df1e62679f8531/src/client/client.ts#L256) and [DELETE](https://github.com/algorand/js-algorand-sdk/blob/0039284f1ecf77b609acab9da3df1e62679f8531/src/client/client.ts#L287) request implementations always assume the response is JSON.

More context here: https://github.com/algorand/js-algorand-sdk/pull/749#discussion_r1143845809

## Solution

We should improve these handlers to behave like [GET](https://github.com/algorand/js-algorand-sdk/blob/0039284f1ecf77b609acab9da3df1e62679f8531/src/client/client.ts#L228), which figures out the response format based on the query parameters for the call, using `getAcceptFormat(query)`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.