rpc_http
« Previous section Next section »
UCloud Developer Guide / Developing UCloud / Micro Library Reference / RPC / RPC HTTP
RPC HTTP
Configures the HTTP backend for this call.
Fields | Mandatory | Description |
---|---|---|
| ❌ No
Default: | HTTP method used for this call |
✅ Yes | Configures the | |
❌ No | Configures the | |
❌ No | Configures how HTTP Request headers affect this request | |
❌ No | Configures how HTTP request body affect this request |
path
path
Defines how the message should be parsed from the path.
Function | Description |
---|---|
| Defines the path prefix, commonly used to define a shared prefix in a call description container |
| Adds a new fixed path segment |
| binds the value to |
params
params
Defines how the message should be parsed from the URL parameters.
Function | Description |
---|---|
| Binds to a parameter (called by the exact name of the property) |
headers
headers
Defines how the message should be parsed from the HTTP request headers.
Function | Description |
---|---|
| Requires the |
| Requires the |
| Binds the |
Note: When using the boundTo()
function, header values will be serialized and deserialized as Base64. This is done to ensure that any value can be put into the header safely.
body
body
Defines how the message should be parsed from the HTTP request body. At the moment this will only read JSON messages.
Function | Description |
---|---|
| Reads the full request type via the body |
| Reads the request body and binds it to a sub-property of the request type |
Examples
Example: POST
request with entire request in body
The above RPC will listen on POST /api/avatar/update
.
Example: GET
request with pagination
Example: File upload with metadata passed in headers
Example: Reading parameters from the path segment
Last updated