Oat++ Нет сопоставления для HTTP-методаC++

Программы на C++. Форум разработчиков
Ответить
Anonymous
 Oat++ Нет сопоставления для HTTP-метода

Сообщение Anonymous »


I am building an endpoint that requires 2 query parameters: email_address and token, the issue I am seeing is that when I make the following call from Postman every other click is an error:

http://localhost:8000/handshake/is_vali ... en?param=p The error message:

server=oatpp/1.3.0 code=404 description=Not Found message=No mapping for HTTP-method: '{', URL: '' Code:

ENDPOINT("POST", "handshake/is_valid_user_token/*", isValidUserToken, REQUEST(std::shared_ptr, request)) { auto tail = request->getPathTail(); auto queryParams = oatpp::network::Url::Parser::parseQueryParams(tail); auto emailAddress = queryParams.get("email_address"); auto userToken = queryParams.get("token"); if (!emailAddress || !userToken) { return ApiResponseFactory::createResponse ( ApiResponseStatus::CODE_401, "Missing email or token"); } return ApiResponseFactory::createResponse ( ApiResponseStatus::CODE_401, "OK"); } I am using Oat++ 1.3.0, this issue manifests itself on both a Mac, Linux and Windows (Visual Studio project). Any suggestions would be gratefully accepted as I appear to be doing it as expected. Used this for reference

Could the controller object be going out of scope, thus causing the incomplete error message?

Here is the code related to it:

void AddApiController( std::shared_ptr controller) { provider.router>addController(controller); } How it's called:
auto controller = std::make_shared< HandshakeApiController> (); AddApiController(controller);

Источник: https://stackoverflow.com/questions/780 ... ttp-method
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C++»