C# 클래스 Systran.NlpClientLib.Client.ApiClient

API client is mainly responible for making the HTTP call to the API backend
파일 보기 프로젝트 열기: SYSTRAN/nlp-api-csharp-client 1 사용 예제들

공개 메소드들

메소드 설명
AddDefaultHeader ( string key, string value ) : void

Add default header

ApiClient ( String basePath = "https://localhost:8202/" ) : System

Initializes a new instance of the ApiClient class.

Base64Encode ( string text ) : string

Encode string in base64 format

CallApi ( String Path, RestSharp Method, String>.Dictionary QueryParams, String PostBody, String>.Dictionary HeaderParams, String>.Dictionary FormParams, String>.Dictionary FileParams, String AuthSettings ) : Object
CallApiAsync ( String Path, RestSharp Method, String>.Dictionary QueryParams, String PostBody, String>.Dictionary HeaderParams, String>.Dictionary FormParams, String>.Dictionary FileParams, String AuthSettings ) : Task
Deserialize ( string content, Type type ) : object

Deserialize the JSON string into a proper object

EscapeString ( string str ) : string

escape string (url-encoded)

GetApiKeyWithPrefix ( string apiKey ) : string

Get the API key with prefix

GetDefaultHeader ( ) : String>.Dictionary

Get default header

ParameterToString ( object obj ) : string

if parameter is DateTime, output in ISO8601 format if parameter is a list of string, join the list with "," otherwise just return the string

Serialize ( object obj ) : string

Serialize an object into JSON string

UpdateParamsForAuth ( String>.Dictionary QueryParams, String>.Dictionary HeaderParams, string AuthSettings ) : void

Update parameters based on authentication

메소드 상세

AddDefaultHeader() 공개 메소드

Add default header
public AddDefaultHeader ( string key, string value ) : void
key string
value string
리턴 void

ApiClient() 공개 메소드

Initializes a new instance of the ApiClient class.
public ApiClient ( String basePath = "https://localhost:8202/" ) : System
basePath String The base path.
리턴 System

Base64Encode() 공개 정적인 메소드

Encode string in base64 format
public static Base64Encode ( string text ) : string
text string String to be encoded
리턴 string

CallApi() 공개 메소드

public CallApi ( String Path, RestSharp Method, String>.Dictionary QueryParams, String PostBody, String>.Dictionary HeaderParams, String>.Dictionary FormParams, String>.Dictionary FileParams, String AuthSettings ) : Object
Path String
Method RestSharp
QueryParams String>.Dictionary
PostBody String
HeaderParams String>.Dictionary
FormParams String>.Dictionary
FileParams String>.Dictionary
AuthSettings String
리턴 Object

CallApiAsync() 공개 메소드

public CallApiAsync ( String Path, RestSharp Method, String>.Dictionary QueryParams, String PostBody, String>.Dictionary HeaderParams, String>.Dictionary FormParams, String>.Dictionary FileParams, String AuthSettings ) : Task
Path String
Method RestSharp
QueryParams String>.Dictionary
PostBody String
HeaderParams String>.Dictionary
FormParams String>.Dictionary
FileParams String>.Dictionary
AuthSettings String
리턴 Task

Deserialize() 공개 메소드

Deserialize the JSON string into a proper object
public Deserialize ( string content, Type type ) : object
content string
type System.Type
리턴 object

EscapeString() 공개 메소드

escape string (url-encoded)
public EscapeString ( string str ) : string
str string
리턴 string

GetApiKeyWithPrefix() 공개 메소드

Get the API key with prefix
public GetApiKeyWithPrefix ( string apiKey ) : string
apiKey string
리턴 string

GetDefaultHeader() 공개 메소드

Get default header
public GetDefaultHeader ( ) : String>.Dictionary
리턴 String>.Dictionary

ParameterToString() 공개 메소드

if parameter is DateTime, output in ISO8601 format if parameter is a list of string, join the list with "," otherwise just return the string
public ParameterToString ( object obj ) : string
obj object
리턴 string

Serialize() 공개 메소드

Serialize an object into JSON string
public Serialize ( object obj ) : string
obj object
리턴 string

UpdateParamsForAuth() 공개 메소드

Update parameters based on authentication
public UpdateParamsForAuth ( String>.Dictionary QueryParams, String>.Dictionary HeaderParams, string AuthSettings ) : void
QueryParams String>.Dictionary Query parameters
HeaderParams String>.Dictionary Header parameters
AuthSettings string Authentication settings
리턴 void