binapi icon indicating copy to clipboard operation
binapi copied to clipboard

add api::common_str

Open 2mhk opened this issue 11 months ago • 2 comments

Add common str post for other request like fapi.

Here is a sample: use url "fapi.binance.com" instead of "api.binance.com"

        auto res0 = api.common_str("/fapi/v1/trades", { {"symbol","BNBUSDT"} });
        if (res0) std::cout << "api.common_str /fapi/v1/trades: " << res0.v << std::endl;

You can parse the json string by yourself. The code is not elegant, but it can be used.

2mhk avatar Feb 20 '25 06:02 2mhk

hi @2mhk

thank you for the PR, I'll try to look at this tshi weekend.

best!

niXman avatar Feb 21 '25 12:02 niXman

Add common str post for other request like fapi.

Here is a sample: use url "fapi.binance.com" instead of "api.binance.com"

        auto res0 = api.common_str("/fapi/v1/trades", { {"symbol","BNBUSDT"} });
        if (res0) std::cout << "api.common_str /fapi/v1/trades: " << res0.v << std::endl;

You can parse the json string by yourself. The code is not elegant, but it can be used.

Hi by "parse the json string by yourself" do you mean that we have to change the mapping from the binance response json to the local variables in binapi? Thanks!

andrewyuyang avatar Mar 13 '25 19:03 andrewyuyang