ImFusion C++ SDK 4.5.0
ImFusion::Network::Response Struct Reference

#include <ImFusionLabels/lib/include/ImFusion/Labels/Core/NetworkUtils.h>

Response of a HTTP request. More...

Inheritance diagram for ImFusion::Network::Response:

Detailed Description

Response of a HTTP request.

Public Member Functions

 Response (Response &&other) noexcept=default
Response & operator= (Response &&other) noexcept=default
QJsonObject json () const
 If Content-Type is 'application/json', returns the body as json.
std::optional< HttpErrorerror () const
 Returns an error if status is not a success value.

Public Attributes

HttpStatus status = HttpStatus::Unknown
 Status code of the response.
std::vector< char > body
 Complete body of the response without any processing done.
std::string contentType
 Content-Type header.
std::string contentDisposition
 Content-Disposition header.

Additional Inherited Members

Protected Member Functions inherited from ImFusion::Utils::NotCopyable
 NotCopyable (NotCopyable &&) noexcept=default
NotCopyable & operator= (NotCopyable &&) noexcept=default
 NotCopyable (const NotCopyable &)=delete
NotCopyable & operator= (const NotCopyable &)=delete

Member Function Documentation

◆ error()

std::optional< HttpError > ImFusion::Network::Response::error ( ) const

Returns an error if status is not a success value.

If the body contains json, it is used in the error message.

Member Data Documentation

◆ status

HttpStatus ImFusion::Network::Response::status = HttpStatus::Unknown

Status code of the response.

Unknown means the request failed before a response was received (e.g. SSL error or some curl specific failure).


The documentation for this struct was generated from the following file:
  • ImFusionLabels/lib/include/ImFusion/Labels/Core/NetworkUtils.h
Search Tab / S to search, Esc to close