@alicloud/pop-core
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -143,3 +143,3 @@ 'use strict'; | ||
request(method, uriPattern, query = {}, body = '', headers = {}, opts) { | ||
request(method, uriPattern, query = {}, body = '', headers = {}, opts = {}) { | ||
var postBody = null; | ||
@@ -172,2 +172,7 @@ | ||
return httpx.read(response, 'utf8').then((body) => { | ||
// Retrun raw body | ||
if (opts.rawBody) { | ||
return body; | ||
} | ||
const contentType = response.headers['content-type'] || ''; | ||
@@ -174,0 +179,0 @@ // JSON |
{ | ||
"name": "@alicloud/pop-core", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "AliCloud POP SDK core", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,2 +17,10 @@ # @alicloud/pop-core | ||
### Notes | ||
You must know your `AK`(`accessKeyId/accessKeySecret`), and the cloud product's `endpoint` and `apiVersion`. | ||
For example, The ECS OpenAPI(https://help.aliyun.com/document_detail/25490.html), the API version is `2014-05-26`. | ||
And the endpoint list can be found at [here](https://help.aliyun.com/document_detail/25489.html), the center endpoint is ecs.aliyuncs.com. Add http protocol `http` or `https`, should be `http://ecs.aliyuncs.com/`. | ||
## Usage | ||
@@ -27,3 +35,3 @@ | ||
accessKeyId: '<accessKeyId>', | ||
secretAccessKey: '<secretAccessKey>', | ||
accessKeySecret: '<accessKeySecret>', | ||
endpoint: '<endpoint>', | ||
@@ -36,2 +44,11 @@ apiVersion: '<apiVersion>' | ||
// co/yield, async/await | ||
// options | ||
client.request(action, params, { | ||
timeout: 3000, // default 3000 ms | ||
formatAction: true, // default true, format the action to Action | ||
formatParams: true, // default true, format the parameter name to first letter upper case | ||
method: 'GET', // set the http method, default is GET | ||
headers: {}, // set the http request headers | ||
}); | ||
``` | ||
@@ -38,0 +55,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16080
388
74