Skip to content

extra data present in body #26

Closed
Closed
@cryguy

Description

@cryguy

when writing the response body to a file, i found that it contained extra unwanted data. I was trying to make it get a file from a api, the data is in base64 and it appends value before the expected data

image

the expected result =

image

Any help would be appreciated

used code -

httplib::SSLClient client("example.com", 443);
auto logincheck = "/load?username=" + user + "&product=" + product;
const char* chr = _strdup(logincheck.c_str());
auto res = client.get(chr);
if (res && res->status == 200)
encoded << res->body;

sorry for the bad code format

edit : found that it might be caused by it displaying chunks as the server is sending it with "Transfer-Encoding: chunked"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions