API~weex

stream

The default Content-Type is 'application/x-www-form-urlencoded'.
If you need to POST json, you need to set the Content-Type to 'application/json'.
Used to implement network requests

fetch(options, callback[,progressCallback])

options {Object}: some options for the request

method {string}: HTTP method GET or POST
url {string}: Requested URL
headers {Object}: HTTP request header
type {string}: Response type, json, text or jsonp {It is actually the same as json in the native implementation )
body {string}: HTTP request body. Only parameters of type string are supported, do not pass JSON directly, you must convert it to a string first.

callback {Function}: The response result callback, the callback function will receive the following response object:

status {number}: the returned status code
ok {boolean}: true if the status code is between 200 and 299.
statusText {string}: Status description text
data {Object | string}: Returned data, if the request type is json and jsonp, it is an object, if not, it is a string.
headers {Object}: response headers

progressCallback {Function}: A callback about the status of the request. This callback function will be called after the request completes:

readyState {number}: Current state
state: '1': Requesting connection
opened: '2': Returned in the response header
received: '3': Loading return data
status {number}: Response status code.
length {number}: The length of the data that has been received. You can get the total length from the response headers
statusText{string}: status text
headers {Object}: response headers

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325262533&siteId=291194637