Function headerParam
Declare that a parameter will be transmitted to the API through the headers.
If the parameter is a string, or any scalar type (float, int, char[], ...), it will be send as a string. If it's an aggregate, it will be serialized as JSON. However, passing aggregate via header isn't a good practice and should be avoided for new production code.
Parameters
Name | Description |
---|---|
identifier | The name of the parameter to customize. A compiler error will be issued on mismatch. |
field | The name of the header field to use (e.g: 'Accept', 'Content-Type'...). ---- // The server will receive the content of the "Authorization" header. @headerParam("auth", "Authorization") void login(string auth); ---- |