Show / Hide Table of Contents

Class BaseRestClient

A base class for HTTP clients used to communicate with the Klarna APIs

Inheritance
System.Object
BaseRestClient
BaseStore
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Klarna.Rest.Core.Commuication
Assembly: Klarna.Rest.Core.dll
Syntax
public abstract class BaseRestClient

Constructors

| Improve this Doc View Source

BaseRestClient(ApiSession, IJsonSerializer)

Constructor

Declaration
protected BaseRestClient(ApiSession apiSession, IJsonSerializer jsonSerializer)
Parameters
Type Name Description
ApiSession apiSession

The API session instance used to communicate with Klarna APIs

IJsonSerializer jsonSerializer

The JSON Serializer instance to use when sending / receiving data

Fields

| Improve this Doc View Source

ApiSession

Session information related to this RestClient

Declaration
protected readonly ApiSession ApiSession
Field Value
Type Description
ApiSession

Methods

| Improve this Doc View Source

Delete(String, Object, IDictionary<String, String>)

Declaration
protected Task Delete(string url, object data = null, IDictionary<string, string> headers = null)
Parameters
Type Name Description
System.String url
System.Object data
System.Collections.Generic.IDictionary<System.String, System.String> headers
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

Delete<T>(String, Object, IDictionary<String, String>)

Declaration
protected Task<T> Delete<T>(string url, object data = null, IDictionary<string, string> headers = null)
Parameters
Type Name Description
System.String url
System.Object data
System.Collections.Generic.IDictionary<System.String, System.String> headers
Returns
Type Description
System.Threading.Tasks.Task<T>
Type Parameters
Name Description
T
| Improve this Doc View Source

Get(String, IDictionary<String, String>)

Declaration
protected Task Get(string url, IDictionary<string, string> headers = null)
Parameters
Type Name Description
System.String url
System.Collections.Generic.IDictionary<System.String, System.String> headers
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

Get<T>(String, IDictionary<String, String>)

Declaration
protected Task<T> Get<T>(string url, IDictionary<string, string> headers = null)
Parameters
Type Name Description
System.String url
System.Collections.Generic.IDictionary<System.String, System.String> headers
Returns
Type Description
System.Threading.Tasks.Task<T>
Type Parameters
Name Description
T
| Improve this Doc View Source

GetStream(String)

Declaration
protected Task<Stream> GetStream(string url)
Parameters
Type Name Description
System.String url
Returns
Type Description
System.Threading.Tasks.Task<System.IO.Stream>
| Improve this Doc View Source

Patch(String, Object, IDictionary<String, String>)

Declaration
protected Task Patch(string url, object data = null, IDictionary<string, string> headers = null)
Parameters
Type Name Description
System.String url
System.Object data
System.Collections.Generic.IDictionary<System.String, System.String> headers
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

Post(String, Object, IDictionary<String, String>)

Handles HTTP POST calls

Declaration
protected Task Post(string url, object data = null, IDictionary<string, string> headers = null)
Parameters
Type Name Description
System.String url

The URL to call

System.Object data

The POST data to send

System.Collections.Generic.IDictionary<System.String, System.String> headers

The HTTP headers to send when performing a POST request

Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

Post<T>(String, Object, IDictionary<String, String>)

Declaration
protected Task<T> Post<T>(string url, object data = null, IDictionary<string, string> headers = null)
Parameters
Type Name Description
System.String url
System.Object data
System.Collections.Generic.IDictionary<System.String, System.String> headers
Returns
Type Description
System.Threading.Tasks.Task<T>
Type Parameters
Name Description
T
| Improve this Doc View Source

Put(String, Object, IDictionary<String, String>)

Declaration
protected Task Put(string url, object data = null, IDictionary<string, string> headers = null)
Parameters
Type Name Description
System.String url
System.Object data
System.Collections.Generic.IDictionary<System.String, System.String> headers
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

Put<T>(String, Object, IDictionary<String, String>)

Declaration
protected Task<T> Put<T>(string url, object data = null, IDictionary<string, string> headers = null)
Parameters
Type Name Description
System.String url
System.Object data
System.Collections.Generic.IDictionary<System.String, System.String> headers
Returns
Type Description
System.Threading.Tasks.Task<T>
Type Parameters
Name Description
T
  • Improve this Doc
  • View Source
Back to top Copyright (c) 2005-2019 Klarna Bank AB (publ). All rights reserved.