Class RestRequest
Definition
- Assembly:
- Tizen.AIAvatar.dll
Represents a RESTful API request.
public class RestRequest
- Inheritance
-
objectRestRequest
Constructors
View SourceRestRequest(string, Method)
Initializes a new instance of the RestRequest class with the specified resource and HTTP method.
Declaration
public RestRequest(string resource, Method method)
Parameters
| Type | Name | Description |
|---|---|---|
| string | resource | The resource URI for the request. |
| Method | method | The HTTP method to use for the request. |
RestRequest(Method)
Initializes a new instance of the RestRequest class with the specified HTTP method.
Declaration
public RestRequest(Method method)
Parameters
| Type | Name | Description |
|---|---|---|
| Method | method | The HTTP method to use for the request. |
Properties
View SourceMethod
The HTTP method to use for the request.
Declaration
public Method Method { get; }
Property Value
| Type | Description |
|---|---|
| Method |
Resource
The resource URI for the request.
Declaration
public string Resource { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
View SourceAddHeader(string, string)
Adds a header to the request.
Declaration
public RestRequest AddHeader(string name, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the header. |
| string | value | The value of the header. |
Returns
| Type | Description |
|---|---|
| RestRequest | The current instance of RestRequest. |
AddJsonBody(object)
Adds a JSON body to the request.
Declaration
public RestRequest AddJsonBody(object body)
Parameters
| Type | Name | Description |
|---|---|---|
| object | body | The object to serialize as JSON and include in the request body. |
Returns
| Type | Description |
|---|---|
| RestRequest | The current instance of RestRequest. |
AddJsonStringBody(string)
Adds a JSON string body to the request.
Declaration
public RestRequest AddJsonStringBody(string jsonString)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jsonString | The JSON string to include in the request body. |
Returns
| Type | Description |
|---|---|
| RestRequest | The current instance of RestRequest. |