Skip to content

Unable to retrieve data from request GET typed with getBody() #2

@leomlr

Description

@leomlr

Hi,
Thanks for implementing this library to manage GET/POST requests.
I encountered a problem when trying to retrieve data from an HTML page after sending a GET request.

It seems that the http.getBody() method is unable to retrieve the string content due to low memory. Considering the size of the data in an HTML page, I suggest using std::move() which steals the memory location of http.body. So I modified the getBody() function accordingly.

In R4HttpClient.h, I changed for:

String R4HttpClient::getBody()
{
  return std::move(this->body);
}

In this sense, it is possible to reassign a variable of type String in the main program and thus use it.
What do you think about this?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions