C# 클래스 IO.Swagger.Client.ApiClient

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

공개 메소드들

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

Add default header.

ApiClient ( String basePath = "http://petstore.swagger.io/v2" ) : 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, FileParameter>.Dictionary fileParams, String authSettings ) : Object

Makes the HTTP request (Sync).

ConvertType ( Object source, Type dest ) : Object

Dynamically cast the object into target type. Ref: http://stackoverflow.com/questions/4925718/c-dynamic-runtime-cast

Deserialize ( string content, Type type, IList headers = null ) : object

Deserialize the JSON string into a proper object.

EscapeString ( string str ) : string

Escape string (url-encoded).

GetApiKeyWithPrefix ( string apiKeyIdentifier ) : string

Get the API key with prefix.

ParameterToFile ( string name, Stream stream ) : FileParameter

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 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 Header field name.
value string Header field value.
리턴 void

ApiClient() 공개 메소드

Initializes a new instance of the ApiClient class.
public ApiClient ( String basePath = "http://petstore.swagger.io/v2" ) : 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() 공개 메소드

Makes the HTTP request (Sync).
public CallApi ( String path, RestSharp method, String>.Dictionary queryParams, String postBody, String>.Dictionary headerParams, String>.Dictionary formParams, FileParameter>.Dictionary fileParams, String authSettings ) : Object
path String URL path.
method RestSharp HTTP method.
queryParams String>.Dictionary Query parameters.
postBody String HTTP body (POST request).
headerParams String>.Dictionary Header parameters.
formParams String>.Dictionary Form parameters.
fileParams FileParameter>.Dictionary File parameters.
authSettings String Authentication settings.
리턴 Object

ConvertType() 공개 정적인 메소드

Dynamically cast the object into target type. Ref: http://stackoverflow.com/questions/4925718/c-dynamic-runtime-cast
public static ConvertType ( Object source, Type dest ) : Object
source Object Object to be casted
dest System.Type Target type
리턴 Object

Deserialize() 공개 메소드

Deserialize the JSON string into a proper object.
public Deserialize ( string content, Type type, IList headers = null ) : object
content string HTTP body (e.g. string, JSON).
type System.Type Object type.
headers IList HTTP headers.
리턴 object

EscapeString() 공개 메소드

Escape string (url-encoded).
public EscapeString ( string str ) : string
str string String to be escaped.
리턴 string

GetApiKeyWithPrefix() 공개 메소드

Get the API key with prefix.
public GetApiKeyWithPrefix ( string apiKeyIdentifier ) : string
apiKeyIdentifier string API key identifier (authentication scheme).
리턴 string

ParameterToFile() 공개 메소드

Create FileParameter based on Stream.
public ParameterToFile ( string name, Stream stream ) : FileParameter
name string Parameter name.
stream Stream Input stream.
리턴 RestSharp.FileParameter

ParameterToString() 공개 메소드

If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. If parameter is a list of string, join the list with ",". Otherwise just return the string.
public ParameterToString ( object obj ) : string
obj object The parameter (header, path, query, form).
리턴 string

Serialize() 공개 메소드

Serialize an object into JSON string.
public Serialize ( object obj ) : string
obj object 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