Open remioukrat opened 1 year ago
Hello @remioukrat ,
when we try to read DTO like this return request->readBodyToDtoAsync<Object
>(controller->getDefaultObjectMapper()).callbackTo(&MyClass::MyCallback); There is a problem with the bodyDecoder and the callback is not called.
That's because you are trying to make JSON
mapper to read application/x-www-form-urlencoded
You have to read body to string first, and then parse that body on your own.
return request->readBodyToString().callbackTo(&MyClass::MyCallback);
If we want to a consume DTO like this
info->addConsumes<Object<MyDTO>>("application/x-www-form-urlencoded");
when we try to read DTO like this
return request->readBodyToDtoAsync<Object<MyDTO>>(controller->getDefaultObjectMapper()).callbackTo(&MyClass::MyCallback);
There is a problem with the bodyDecoder and the callback is not called.