Method | Description | |
---|---|---|
ApiClient ( ) : System |
Initializes a new instance of the ApiClient class with default configuration and base path (https://docraptor.com/).
|
|
ApiClient ( |
Initializes a new instance of the ApiClient class with default base path (https://docraptor.com/).
|
|
ApiClient ( String basePath = "https://docraptor.com/" ) : System |
Initializes a new instance of the ApiClient class with default configuration.
|
|
Base64Encode ( string text ) : string |
Encode string in base64 format.
|
|
CallApi ( String path, RestSharp method, String>.Dictionary |
Makes the HTTP request (Sync).
|
|
CallApiAsync ( String path, RestSharp method, String>.Dictionary |
Makes the asynchronous HTTP request.
|
|
ConvertType ( dynamic source, |
Dynamically cast the object into target type. Ref: http://stackoverflow.com/questions/4925718/c-dynamic-runtime-cast
|
|
Deserialize ( IRestResponse response, |
Deserialize the JSON string into a proper object.
|
|
EscapeString ( string str ) : string |
Escape string (url-encoded).
|
|
ParameterToFile ( string name, Stream stream ) : |
Create FileParameter based on Stream.
|
|
ParameterToString ( object obj ) : string |
If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. If parameter is a list, join the list with ",". Otherwise just return the string.
|
|
ReadAsBytes ( Stream input ) : byte[] |
Convert stream to byte array Credit/Ref: http://stackoverflow.com/a/221941/677735
|
|
SanitizeFilename ( string filename ) : string |
Sanitize filename by removing the path
|
|
SelectHeaderAccept ( String accepts ) : String |
Select the Accept header's value from the given accepts array: if JSON exists in the given array, use it; otherwise use all of them (joining into a string)
|
|
SelectHeaderContentType ( String contentTypes ) : String |
Select the Content-Type header's value from the given content-type array: if JSON exists in the given array, use it; otherwise use the first one defined in 'consumes'
|
|
Serialize ( object obj ) : String |
Serialize an input (model) into JSON string
|
|
UrlEncode ( string input ) : string |
URL encode a string Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50
|
Method | Description | |
---|---|---|
PrepareRequest ( String path, RestSharp method, String>.Dictionary |
public ApiClient ( |
||
config | An instance of Configuration. | |
return | System |
public ApiClient ( String basePath = "https://docraptor.com/" ) : System | ||
basePath | String | The base path. |
return | System |
public static Base64Encode ( string text ) : string | ||
text | string | String to be encoded. |
return | string |
public CallApi ( String path, RestSharp method, String>.Dictionary |
||
path | String | URL path. |
method | RestSharp | HTTP method. |
queryParams | String>.Dictionary | Query parameters. |
postBody | Object | HTTP body (POST request). |
headerParams | String>.Dictionary | Header parameters. |
formParams | String>.Dictionary | Form parameters. |
fileParams | FileParameter>.Dictionary | File parameters. |
pathParams | String>.Dictionary | Path parameters. |
contentType | String | Content Type of the request |
return | Object |
public CallApiAsync ( String path, RestSharp method, String>.Dictionary |
||
path | String | URL path. |
method | RestSharp | HTTP method. |
queryParams | String>.Dictionary | Query parameters. |
postBody | Object | HTTP body (POST request). |
headerParams | String>.Dictionary | Header parameters. |
formParams | String>.Dictionary | Form parameters. |
fileParams | FileParameter>.Dictionary | File parameters. |
pathParams | String>.Dictionary | Path parameters. |
contentType | String | Content type. |
return | System.Threading.Tasks.Task |
public static ConvertType ( dynamic source, |
||
source | dynamic | Object to be casted |
dest | Target type | |
return | dynamic |
public Deserialize ( IRestResponse response, |
||
response | IRestResponse | The HTTP response. |
type | Object type. | |
return | object |
public EscapeString ( string str ) : string | ||
str | string | String to be escaped. |
return | string |
public ParameterToFile ( string name, Stream stream ) : |
||
name | string | Parameter name. |
stream | Stream | Input stream. |
return |
public ParameterToString ( object obj ) : string | ||
obj | object | The parameter (header, path, query, form). |
return | string |
public static ReadAsBytes ( Stream input ) : byte[] | ||
input | Stream | Input stream to be converted |
return | byte[] |
public static SanitizeFilename ( string filename ) : string | ||
filename | string | Filename |
return | string |
public SelectHeaderAccept ( String accepts ) : String | ||
accepts | String | The accepts array to select from. |
return | String |
public SelectHeaderContentType ( String contentTypes ) : String | ||
contentTypes | String | The Content-Type array to select from. |
return | String |
public static UrlEncode ( string input ) : string | ||
input | string | String to be URL encoded |
return | string |