WebResource class
Constructors
Web |
Creates a new WebResource object. |
Properties
body | |
headers | |
headers |
|
method | |
path | |
properties | |
query |
|
raw |
|
uri |
Methods
del(string) | Creates a new delete request web resource. |
get(string) | Creates a new get request web resource. |
head(string) | Creates a new head request web resource. |
merge(string) | Creates a new merge request web resource. |
pipe |
Hook up the given input stream to a destination output stream if the WebResource method requires a request body and a body is not already set. |
post(string) | Creates a new post request web resource. |
put(string) | Creates a new put request web resource. |
valid |
Adds optional query string parameters. Additional arguments will be the needles to search in the haystack. |
with |
Adds an optional body. |
with |
Adds an optional header parameter. |
with |
Specifies if the request only has headers. |
with |
Specifies a custom property in the web resource. |
with |
Adds an optional query string parameter. |
with |
Adds optional query string parameters. Additional arguments will be the needles to search in the haystack. |
with |
Specifies if the response should be parsed or not. |
Constructor Details
WebResource()
Creates a new WebResource object.
new WebResource()
Property Details
body
body: any
Property Value
any
headers
headers: Map<any>
Property Value
Map<any>
headersOnly
headersOnly: boolean
Property Value
boolean
method
method: string
Property Value
string
path
path: string
Property Value
string
properties
properties: Map<string>
Property Value
Map<string>
queryString
queryString: any
Property Value
any
rawResponse
rawResponse: boolean
Property Value
boolean
uri
uri: string
Property Value
string
Method Details
del(string)
Creates a new delete request web resource.
static function del(path: string): WebResource
Parameters
- path
-
string
The path for the delete operation.
Returns
azure-storage.export=.common.http.webresource.WebResource
A new webresource with a delete operation for the given path.
get(string)
Creates a new get request web resource.
static function get(path?: string): WebResource
Parameters
- path
-
string
The path for the get operation.
Returns
azure-storage.export=.common.http.webresource.WebResource
A new webresource with a get operation for the given path.
head(string)
Creates a new head request web resource.
static function head(path: string): WebResource
Parameters
- path
-
string
The path for the head operation.
Returns
azure-storage.export=.common.http.webresource.WebResource
A new webresource with a head operation for the given path.
merge(string)
Creates a new merge request web resource.
static function merge(path: string): WebResource
Parameters
- path
-
string
The path for the merge operation.
Returns
azure-storage.export=.common.http.webresource.WebResource
A new webresource with a merge operation for the given path.
pipeInput(ReadableStream, WritableStream)
Hook up the given input stream to a destination output stream if the WebResource method requires a request body and a body is not already set.
function pipeInput(inputStream: ReadableStream, destStream: WritableStream): WritableStream
Parameters
- inputStream
-
ReadableStream
the stream to pipe from
- destStream
-
WritableStream
Returns
WritableStream
destStream
post(string)
Creates a new post request web resource.
static function post(path: string): WebResource
Parameters
- path
-
string
The path for the post operation.
Returns
azure-storage.export=.common.http.webresource.WebResource
A new webresource with a post operation for the given path.
put(string)
Creates a new put request web resource.
static function put(path?: string): WebResource
Parameters
- path
-
string
The path for the put operation.
Returns
azure-storage.export=.common.http.webresource.WebResource
A new webresource with a put operation for the given path.
validResponse(number)
Adds optional query string parameters.
Additional arguments will be the needles to search in the haystack.
static function validResponse(statusCode: number): boolean
Parameters
- statusCode
-
number
The response status code.
Returns
boolean
The web resource. withHeaders(object: { [x: string]: any; }, ...args: string[]): WebResource; addOptionalMetadataHeaders(metadata: any): WebResource; /** Determines if a status code corresponds to a valid response according to the WebResource's expected status codes.
withBody(any)
Adds an optional body.
function withBody(body: any): WebResource
Parameters
- body
-
any
The request body.
Returns
azure-storage.export=.common.http.webresource.WebResource
The web resource.
withHeader<T>(string, T)
Adds an optional header parameter.
function withHeader<T>(name: string, value: T): WebResource
Parameters
- name
-
string
The name of the header parameter.
- value
-
T
The value of the header parameter.
Returns
azure-storage.export=.common.http.webresource.WebResource
The web resource.
withHeadersOnly(boolean)
Specifies if the request only has headers.
function withHeadersOnly(headersOnly?: boolean): WebResource
Parameters
- headersOnly
-
boolean
true if the request only has headers; false otherwise.
Returns
azure-storage.export=.common.http.webresource.WebResource
The webresource.
withProperty(string, string)
Specifies a custom property in the web resource.
function withProperty(name: string, value: string): WebResource
Parameters
- name
-
string
The property name.
- value
-
string
The property value.
Returns
azure-storage.export=.common.http.webresource.WebResource
The webresource.
withQueryOption<T>(any, T, T)
Adds an optional query string parameter.
function withQueryOption<T>(name: any, value: T, defaultValue?: T): WebResource
Parameters
- name
-
any
The name of the query string parameter.
- value
-
T
The value of the query string parameter.
- defaultValue
-
T
The default value for the query string parameter to be used if no value is passed.
Returns
azure-storage.export=.common.http.webresource.WebResource
The web resource.
withQueryOptions(any, any[])
Adds optional query string parameters.
Additional arguments will be the needles to search in the haystack.
function withQueryOptions(object: any, queryArgs: any[]): WebResource
Parameters
- object
-
any
The haystack of query string parameters.
- queryArgs
-
any[]
Returns
azure-storage.export=.common.http.webresource.WebResource
The web resource.
withRawResponse(boolean)
Specifies if the response should be parsed or not.
function withRawResponse(rawResponse?: boolean): WebResource
Parameters
- rawResponse
-
boolean
true if the response should not be parsed; false otherwise.
Returns
azure-storage.export=.common.http.webresource.WebResource
The webresource.
Azure SDK for JavaScript
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for