MXS-1220: Add versioned URLs

Added versioning to URLs. This should allow somewhat safe modification to
the API after it has been finished.
This commit is contained in:
Markus Mäkelä
2017-05-02 16:34:41 +03:00
parent 0ea58ea6bc
commit b2e94fc73c
5 changed files with 49 additions and 15 deletions

View File

@ -102,7 +102,12 @@ int Client::process(string url, string method, const char* upload_data, size_t *
}
HttpRequest request(m_connection, url, method, json);
HttpResponse reply = resource_handle_request(request);
HttpResponse reply(MHD_HTTP_NOT_FOUND);
if (request.validate_api_version())
{
reply = resource_handle_request(request);
}
string data;