Class to handle http(s) requests, build headers, collect data, report status codes, and header responses and passes control to session object for maintaining connection information (tokens, checking for timeout, etc...)

export

### Hierarchy

- AbstractRestClient
  - RestClient

## Index

### Constructors

- constructor

### Properties

- lastByteReceived
- lastByteReceivedUpload
- mBytesReceived
- mChunks
- mContentEncoding
- mContentLength
- mData
- mDecode
- mDecodeStream
- mIsJson
- mLogger
- mNormalizeRequestNewlines
- mNormalizeResponseNewlines
- mReject
- mReqHeaders
- mRequest
- mRequestStream
- mResolve
- mResource
- mResponse
- mResponseStream
- mTask
- mWriteData

### Accessors

- data
- dataString
- log
- requestFailure
- requestSuccess
- response
- session

### Methods

- appendHeaders
- processError
- request
- deleteExpectBuffer
- deleteExpectFullResponse
- deleteExpectJSON
- deleteExpectString
- deleteStreamed
- extractExpectedData
- getExpectBuffer
- getExpectFullResponse
- getExpectJSON
- getExpectString
- getStreamed
- hasQueryString
- postExpectBuffer
- postExpectFullResponse
- postExpectJSON
- postExpectString
- postStreamed
- postStreamedRequestOnly
- putExpectBuffer
- putExpectFullResponse
- putExpectJSON
- putExpectString
- putStreamed
- putStreamedRequestOnly

## Constructors

### constructor

- new RestClient(session: AbstractSession): RestClient

- Overrides AbstractRestClient.constructor

  - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:32

  Creates an instance of RestClient and sets the default authentication order to place basic at the top.

  memberof

    AbstractRestClient

  #### Parameters

  - ##### session: AbstractSession

    a session connection for this api

  #### Returns RestClient

## Properties

### Private lastByteReceived

lastByteReceived: number = 0

Inherited from AbstractRestClient.lastByteReceived

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:234

Last byte received when response is being streamed

memberof

  AbstractRestClient

### Private lastByteReceivedUpload

lastByteReceivedUpload: number = 0

Inherited from AbstractRestClient.lastByteReceivedUpload

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:242

Last byte received when upload is being streamed

memberof

  AbstractRestClient

### Private mBytesReceived

mBytesReceived: number = 0

Inherited from AbstractRestClient.mBytesReceived

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:218

Bytes received from the server response so far

memberof

  AbstractRestClient

### Private mChunks

mChunks: Buffer[] = []

Inherited from AbstractRestClient.mChunks

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:58

Contains REST chucks

memberof

  AbstractRestClient

### Private mContentEncoding

mContentEncoding: ContentEncoding

Inherited from AbstractRestClient.mContentEncoding

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:117

If we get a response containing a Content-Encoding header, and it matches an encoding type that we recognize, it is saved here

memberof

  AbstractRestClient

### Private mContentLength

mContentLength: number

Inherited from AbstractRestClient.mContentLength

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:107

If we get a response containing a Content-Length header, it is saved here

memberof

  AbstractRestClient

### Private mData

mData: Buffer = Buffer.from([])

Inherited from AbstractRestClient.mData

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:66

Contains buffered data after all REST chucks are received

memberof

  AbstractRestClient

### Private mDecode

mDecode: boolean = true

Inherited from AbstractRestClient.mDecode

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:226

Whether or not to try and decode any encoded response

memberof

  AbstractRestClient

### Private mDecodeStream

mDecodeStream: Writable

Inherited from AbstractRestClient.mDecodeStream

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:193

If content encoding is used, this is the decompression stream that we write to. It pipes through transforms to mResponseStream.

memberof

  AbstractRestClient

### Private mIsJson

mIsJson: boolean

Inherited from AbstractRestClient.mIsJson

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:125

Indicates if payload data is JSON to be stringified before writing

memberof

  AbstractRestClient

### Private mLogger

mLogger: Logger

Inherited from AbstractRestClient.mLogger

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:74

Instance of logger

memberof

  AbstractRestClient

### Private mNormalizeRequestNewlines

mNormalizeRequestNewlines: boolean

Inherited from AbstractRestClient.mNormalizeRequestNewlines

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:134

Indicates if request data should have its newlines normalized to /n before sending each chunk to the server

memberof

  AbstractRestClient

### Private mNormalizeResponseNewlines

mNormalizeResponseNewlines: boolean

Inherited from AbstractRestClient.mNormalizeResponseNewlines

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:143

Indicates if response data should have its newlines normalized for the current platform (\r\n for windows, otherwise \n)

memberof

  AbstractRestClient

### Private mReject

mReject: ImperativeReject

Inherited from AbstractRestClient.mReject

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:90

Reject for errors when obtaining data

memberof

  AbstractRestClient

### Private mReqHeaders

mReqHeaders: any[]

Inherited from AbstractRestClient.mReqHeaders

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:167

Save req headers

memberof

  AbstractRestClient

### Private mRequest

mRequest: HTTP_VERB

Inherited from AbstractRestClient.mRequest

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:159

Save request

memberof

  AbstractRestClient

### Private mRequestStream

mRequestStream: Readable

Inherited from AbstractRestClient.mRequestStream

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:201

stream for outgoing request data to the server

memberof

  AbstractRestClient

### Private mResolve

mResolve: RestClientResolve

Inherited from AbstractRestClient.mResolve

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:82

Resolved when all data has been obtained

memberof

  AbstractRestClient

### Private mResource

mResource: string

Inherited from AbstractRestClient.mResource

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:151

Save resource

memberof

  AbstractRestClient

### Private mResponse

mResponse: any

Inherited from AbstractRestClient.mResponse

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:98

Contain response from http(s) request

memberof

  AbstractRestClient

### Private mResponseStream

mResponseStream: Writable

Inherited from AbstractRestClient.mResponseStream

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:184

Stream for incoming response data from the server. If specified, response data will not be buffered

memberof

  AbstractRestClient

### Private mTask

mTask: ITaskWithStatus

Inherited from AbstractRestClient.mTask

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:210

Task used to display progress bars or other user feedback mechanisms Automatically updated if task is specified and streams are provided for upload/download

memberof

  AbstractRestClient

### Private mWriteData

mWriteData: any

Inherited from AbstractRestClient.mWriteData

- Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:175

Save write data

memberof

  AbstractRestClient

## Accessors

### data

- get data(): Buffer

- Inherited from AbstractRestClient.data

  - Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:1127

  Return http(s) response body as a buffer

  readonly
  memberof

    AbstractRestClient

  #### Returns Buffer

### dataString

- get dataString(): string

- Inherited from AbstractRestClient.dataString

  - Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:1137

  Return http(s) response body as a string

  readonly
  memberof

    AbstractRestClient

  #### Returns string

### log

- get log(): Logger

- Inherited from AbstractRestClient.log

  - Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:1170

  Return the logger object for ease of reference

  readonly
  memberof

    AbstractRestClient

  #### Returns Logger

### requestFailure

- get requestFailure(): boolean

- Inherited from AbstractRestClient.requestFailure

  - Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:1117

  Return whether or not a REST request was successful by HTTP status code

  readonly
  memberof

    AbstractRestClient

  #### Returns boolean

### requestSuccess

- get requestSuccess(): boolean

- Inherited from AbstractRestClient.requestSuccess

  - Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:1102

  Return whether or not a REST request was successful by HTTP status code

  readonly
  memberof

    AbstractRestClient

  #### Returns boolean

### response

- get response(): any

- Inherited from AbstractRestClient.response

  - Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:1150

  Return http(s) response object

  readonly
  memberof

    AbstractRestClient

  #### Returns any

### session

- get session(): Session

- Inherited from AbstractRestClient.session

  - Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:1160

  Return this session object

  readonly
  memberof

    AbstractRestClient

  #### Returns Session

## Methods

### Protected appendHeaders

- appendHeaders(headers: any[] | undefined): any[]

- Inherited from AbstractRestClient.appendHeaders

  - Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:486

  Append specific headers for all requests by overriding this implementation

  memberof

    AbstractRestClient

  #### Parameters

  - ##### headers: any[] | undefined

    list of headers

  #### Returns any[]

  - completed list of headers

### Protected processError

- processError(_error: IImperativeError): IImperativeError

- Inherited from AbstractRestClient.processError

  - Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:507

  Process and customize errors encountered in your client. This is called any time an error is thrown from a failed Rest request using this client. error before receiving any response body from the API. You can use this, for example, to set the error tag for you client or add additional details to the error message. If you return null or undefined, Imperative will use the default error generated for your failed request.

  memberof

    AbstractRestClient

  #### Parameters

  - ##### _error: IImperativeError

  #### Returns IImperativeError

  processedError - the error with the fields set the way you want them

### request

- request(options: IRestOptions): Promise<string>

- Inherited from AbstractRestClient.request

  - Defined in @zowe/imperative/src/rest/src/client/AbstractRestClient.ts:296

  Perform the actual http REST call with appropriate user input

  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    AbstractRestClient

  #### Parameters

  - ##### options: IRestOptions

  #### Returns Promise<string>

### Static deleteExpectBuffer

- deleteExpectBuffer(session: AbstractSession, resource: string, reqHeaders?: any[]): Promise<Buffer>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:182

  REST HTTP DELETE operation

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    URI for which this request should go against

  - ##### Default value reqHeaders: any[] = []

    headers to include in the REST request

  #### Returns Promise<Buffer>

  - response body content from http(s) call

### Static deleteExpectFullResponse

- deleteExpectFullResponse(session: AbstractSession, options: IOptionsFullResponse): Promise<IRestClientResponse>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:460

  REST HTTP delete operation returning full HTTP(S) Response

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### options: IOptionsFullResponse

    list of parameters

  #### Returns Promise<IRestClientResponse>

  - response content from http(s) call

### Static deleteExpectJSON

- deleteExpectJSON<T>(session: AbstractSession, resource: string, reqHeaders?: any[]): Promise<T>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:113

  Wrap post for common error handling and supporting generic JSON types

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Type parameters

  - #### T: object

    object type to return

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    the API URI that we are targeting

  - ##### Default value reqHeaders: any[] = []

    headers for the http(s) request

  #### Returns Promise<T>

  - object on promise

### Static deleteExpectString

- deleteExpectString(session: AbstractSession, resource: string, reqHeaders?: any[]): Promise<string>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:246

  REST HTTP DELETE operation

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    URI for which this request should go against

  - ##### Default value reqHeaders: any[] = []

    headers to include in the REST request

  #### Returns Promise<string>

  - response body content from http(s) call

### Static deleteStreamed

- deleteStreamed(session: AbstractSession, resource: string, reqHeaders?: any[], responseStream: Writable, normalizeResponseNewLines?: boolean, task?: ITaskWithStatus): Promise<string>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:385

  REST HTTP DELETE operation

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    URI for which this request should go against

  - ##### Default value reqHeaders: any[] = []

    headers to include in the REST request

  - ##### responseStream: Writable

    stream to which the response data will be written

  - ##### Optional normalizeResponseNewLines: boolean

    streaming only - true if you want newlines to be \r\n on windows when receiving data from the server to responseStream. Don't set this for binary responses

  - ##### Optional task: ITaskWithStatus

    task used to update the user on the progress of their request

  #### Returns Promise<string>

  - empty string - data is not buffered for streamed requests

### Static Private extractExpectedData

- extractExpectedData(client: AbstractRestClient, toReturn?: CLIENT_PROPERTY[]): IRestClientResponse

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:528

  Helper method to extract requested data from response object If list is not passed, returns entire response

  static
  memberof

    RestClient

  #### Parameters

  - ##### client: AbstractRestClient

    HTTP(S) response object

  - ##### Default value toReturn: CLIENT_PROPERTY[] = Object.values(CLIENT_PROPERTY)

    list with object properties to return

  #### Returns IRestClientResponse

  - trimmed or full response object based on the list provided

### Static getExpectBuffer

- getExpectBuffer(session: AbstractSession, resource: string, reqHeaders?: any[]): Promise<Buffer>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:129

  REST HTTP GET operation

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    URI for which this request should go against

  - ##### Default value reqHeaders: any[] = []

    headers to include in the REST request

  #### Returns Promise<Buffer>

  - response body content from http(s) call

### Static getExpectFullResponse

- getExpectFullResponse(session: AbstractSession, options: IOptionsFullResponse): Promise<IRestClientResponse>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:402

  REST HTTP GET operation returning full HTTP(S) Response

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### options: IOptionsFullResponse

    URI for which this request should go against

  #### Returns Promise<IRestClientResponse>

  - full response or filtered based on provided params

### Static getExpectJSON

- getExpectJSON<T>(session: AbstractSession, resource: string, reqHeaders?: any[]): Promise<T>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:57

  Wrap get for common error handling and supporting generic JSON types

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Type parameters

  - #### T: object

    object type to return

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    the API URI that we are targeting

  - ##### Default value reqHeaders: any[] = []

    headers for the http(s) request

  #### Returns Promise<T>

  - object on promise

### Static getExpectString

- getExpectString(session: AbstractSession, resource: string, reqHeaders?: any[]): Promise<string>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:199

  REST HTTP GET operation

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    URI for which this request should go against

  - ##### Default value reqHeaders: any[] = []

    headers to include in the REST request

  #### Returns Promise<string>

  - response body content from http(s) call

### Static getStreamed

- getStreamed(session: AbstractSession, resource: string, reqHeaders?: any[], responseStream: Writable, normalizeResponseNewLines?: boolean, task?: ITaskWithStatus): Promise<string>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:265

  REST HTTP GET operation - streaming the response to a writable stream

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    URI for which this request should go against

  - ##### Default value reqHeaders: any[] = []

    headers to include in the REST request

  - ##### responseStream: Writable

    the stream to which the response data will be written

  - ##### Optional normalizeResponseNewLines: boolean

    streaming only - true if you want newlines to be \r\n on windows when receiving data from the server to responseStream. Don't set this for binary responses

  - ##### Optional task: ITaskWithStatus

    task used to update the user on the progress of their request

  #### Returns Promise<string>

  - empty string - data is not buffered for this request

### Static hasQueryString

- hasQueryString(query: string): boolean

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:515

  Helper method to return an indicator for whether or not a URI contains a query string.

  static
  memberof

    RestClient

  #### Parameters

  - ##### query: string

    URI

  #### Returns boolean

  - true if query is contained within URI

### Static postExpectBuffer

- postExpectBuffer(session: AbstractSession, resource: string, reqHeaders?: any[], data?: any): Promise<Buffer>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:165

  REST HTTP POST operation

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    URI for which this request should go against

  - ##### Default value reqHeaders: any[] = []

    headers to include in the REST request

  - ##### Optional data: any

    payload data

  #### Returns Promise<Buffer>

  - response body content from http(s) call

### Static postExpectFullResponse

- postExpectFullResponse(session: AbstractSession, options: IOptionsFullResponse): Promise<IRestClientResponse>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:489

  REST HTTP post operation returning full HTTP(S) Response

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### options: IOptionsFullResponse

    list of parameters

  #### Returns Promise<IRestClientResponse>

  - response content from http(s) call

### Static postExpectJSON

- postExpectJSON<T>(session: AbstractSession, resource: string, reqHeaders?: any[], payload?: any): Promise<T>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:95

  Wrap post for common error handling and supporting generic JSON types

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Type parameters

  - #### T: object

    object type to return

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    the API URI that we are targeting

  - ##### Default value reqHeaders: any[] = []

    headers for the http(s) request

  - ##### Optional payload: any

    data to write on the http(s) request

  #### Returns Promise<T>

  - object on promise

### Static postExpectString

- postExpectString(session: AbstractSession, resource: string, reqHeaders?: any[], data?: any): Promise<string>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:231

  REST HTTP POST operation

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    URI for which this request should go against

  - ##### Default value reqHeaders: any[] = []

    headers to include in the REST request

  - ##### Optional data: any

    payload data

  #### Returns Promise<string>

  - response body content from http(s) call

### Static postStreamed

- postStreamed(session: AbstractSession, resource: string, reqHeaders?: any[], responseStream: Writable, requestStream: Readable, normalizeResponseNewLines?: boolean, normalizeRequestNewLines?: boolean, task?: ITaskWithStatus): Promise<string>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:340

  REST HTTP POST operation streaming both the request and the response

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    URI for which this request should go against

  - ##### Default value reqHeaders: any[] = []

    headers to include in the REST request

  - ##### responseStream: Writable

    stream to which the response data will be written

  - ##### requestStream: Readable

    stream from which payload data will be read

  - ##### Optional normalizeResponseNewLines: boolean

    streaming only - true if you want newlines to be \r\n on windows when receiving data from the server to responseStream. Don't set this for binary responses

  - ##### Optional normalizeRequestNewLines: boolean

    streaming only - true if you want \r\n to be replaced with \n when sending data to the server from requestStream. Don't set this for binary requests

  - ##### Optional task: ITaskWithStatus

    task used to update the user on the progress of their request

  #### Returns Promise<string>

  - empty string - data is not buffered for this request

### Static postStreamedRequestOnly

- postStreamedRequestOnly(session: AbstractSession, resource: string, reqHeaders?: any[], requestStream: Readable, normalizeRequestNewLines?: boolean, task?: ITaskWithStatus): Promise<string>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:363

  REST HTTP POST operation, streaming only the request and not the response

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    URI for which this request should go against

  - ##### Default value reqHeaders: any[] = []

    headers to include in the REST request

  - ##### requestStream: Readable

    stream from which payload data will be read

  - ##### Optional normalizeRequestNewLines: boolean

    streaming only - true if you want \r\n to be replaced with \n when sending data to the server from requestStream. Don't set this for binary requests

  - ##### Optional task: ITaskWithStatus

    task used to update the user on the progress of their request

  #### Returns Promise<string>

  - string of the response

### Static putExpectBuffer

- putExpectBuffer(session: AbstractSession, resource: string, reqHeaders?: any[], data: any): Promise<Buffer>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:147

  REST HTTP PUT operation

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    URI for which this request should go against

  - ##### Default value reqHeaders: any[] = []

    headers to include in the REST request

  - ##### data: any

    payload data

  #### Returns Promise<Buffer>

  - response body content from http(s) call

### Static putExpectFullResponse

- putExpectFullResponse(session: AbstractSession, options: IOptionsFullResponse): Promise<IRestClientResponse>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:431

  REST HTTP PUT operation returning full HTTP(S) Response

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### options: IOptionsFullResponse

    list of parameters

  #### Returns Promise<IRestClientResponse>

  - response content from http(s) call

### Static putExpectJSON

- putExpectJSON<T>(session: AbstractSession, resource: string, reqHeaders?: any[], payload: any): Promise<T>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:76

  Wrap put for common error handling and supporting generic JSON types

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Type parameters

  - #### T: object

    object type to return

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    the API URI that we are targeting

  - ##### Default value reqHeaders: any[] = []

    headers for the http(s) request

  - ##### payload: any

    data to write on the http(s) request

  #### Returns Promise<T>

  - object on promise

### Static putExpectString

- putExpectString(session: AbstractSession, resource: string, reqHeaders?: any[], data: any): Promise<string>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:215

  REST HTTP PUT operation

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    URI for which this request should go against

  - ##### Default value reqHeaders: any[] = []

    headers to include in the REST request

  - ##### data: any

    payload data

  #### Returns Promise<string>

  - response body content from http(s) call

### Static putStreamed

- putStreamed(session: AbstractSession, resource: string, reqHeaders?: any[], responseStream: Writable, requestStream: Readable, normalizeResponseNewLines?: boolean, normalizeRequestNewLines?: boolean, task?: ITaskWithStatus): Promise<string>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:291

  REST HTTP PUT operation with streamed response and request

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    URI for which this request should go against

  - ##### Default value reqHeaders: any[] = []

    headers to include in the REST request

  - ##### responseStream: Writable

    stream to which the response data will be written

  - ##### requestStream: Readable

    stream from which payload data will be read

  - ##### Optional normalizeResponseNewLines: boolean

    streaming only - true if you want newlines to be \r\n on windows when receiving data from the server to responseStream. Don't set this for binary responses

  - ##### Optional normalizeRequestNewLines: boolean

    streaming only - true if you want \r\n to be replaced with \n when sending data to the server from requestStream. Don't set this for binary requests

  - ##### Optional task: ITaskWithStatus

    task used to update the user on the progress of their request

  #### Returns Promise<string>

  - empty string - data is not buffered for streamed requests

### Static putStreamedRequestOnly

- putStreamedRequestOnly(session: AbstractSession, resource: string, reqHeaders?: any[], requestStream: Readable, normalizeRequestNewLines?: boolean, task?: ITaskWithStatus): Promise<string>

- - Defined in @zowe/imperative/src/rest/src/client/RestClient.ts:314

  REST HTTP PUT operation with only streamed request, buffers response data and returns it

  static
  throws

    if the request gets a status code outside of the 200 range or other connection problems occur (e.g. connection refused)

  memberof

    RestClient

  #### Parameters

  - ##### session: AbstractSession

    representing connection to this api

  - ##### resource: string

    URI for which this request should go against

  - ##### Default value reqHeaders: any[] = []

    headers to include in the REST request

  - ##### requestStream: Readable

    stream from which payload data will be read

  - ##### Optional normalizeRequestNewLines: boolean

    streaming only - true if you want \r\n to be replaced with \n when sending data to the server from requestStream. Don't set this for binary requests

  - ##### Optional task: ITaskWithStatus

    task used to update the user on the progress of their request

  #### Returns Promise<string>

  - string of the response

Generated using TypeDoc