#include <userver/clients/http/plugin.hpp>
Base class for HTTP Client plugins.
Definition at line 45 of file plugin.hpp.
|
| Plugin (std::string name) |
|
const std::string & | GetName () const |
| Get plugin name.
|
|
virtual void | HookCreateSpan (PluginRequest &request, tracing::Span &span)=0 |
| The hook is called just after the "external" Span is created. You might want to add custom tags from the hook. The hook is called only once before any network interaction and is NOT called before each retry. The hook is executed in the context of the parent task which created the request.
|
|
virtual void | HookPerformRequest (PluginRequest &request)=0 |
| The hook is called before actual HTTP request sending and before DNS name resolution. This hook is called on each retry.
|
|
virtual void | HookOnCompleted (PluginRequest &request, Response &response)=0 |
| The hook is called after the HTTP response is received. It does not include timeout, network or other error.
|
|
virtual void | HookOnError (PluginRequest &request, std::error_code ec)=0 |
| The hook is called on timeout and other errors. The hook is not called for error HTTP responses, use HookOnCompleted instead.
|
|
virtual bool | HookOnRetry (PluginRequest &request)=0 |
| The hook is called before every call attempt except the first one.
|
|
◆ HookOnCompleted()
The hook is called after the HTTP response is received. It does not include timeout, network or other error.
- Warning
- The hook is called in libev thread, not in coroutine context! Do not do any heavy work here, offload it to other hooks.
◆ HookOnError()
virtual void clients::http::Plugin::HookOnError |
( |
PluginRequest & | request, |
|
|
std::error_code | ec ) |
|
pure virtual |
The hook is called on timeout and other errors. The hook is not called for error HTTP responses, use HookOnCompleted instead.
- Warning
- The hook is called in libev thread, not in coroutine context! Do not do any heavy work here, offload it to other hooks.
◆ HookOnRetry()
virtual bool clients::http::Plugin::HookOnRetry |
( |
PluginRequest & | request | ) |
|
|
pure virtual |
The hook is called before every call attempt except the first one.
- Returns
- whether the retry is allowed.
◆ HookPerformRequest()
virtual void clients::http::Plugin::HookPerformRequest |
( |
PluginRequest & | request | ) |
|
|
pure virtual |
The hook is called before actual HTTP request sending and before DNS name resolution. This hook is called on each retry.
- Warning
- The hook is called in libev thread, not in coroutine context! Do not do any heavy work here, offload it to other hooks.
The documentation for this class was generated from the following file: