You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
564 B
22 lines
564 B
import adapter from './adapters/http'
|
|
import { forEach } from './utils'
|
|
|
|
export const METHOD = ['get', 'post', 'put', 'delete', 'connect', 'head', 'options', 'trace']
|
|
export const HEADER = ['common', ...METHOD]
|
|
|
|
const defaults = {
|
|
adapter,
|
|
header: {},
|
|
method: 'GET',
|
|
// timeout: 60000,
|
|
// dataType: 'json',
|
|
// responseType: 'text',
|
|
// sslVerify: true,
|
|
// withCredentials: false,
|
|
// firstIpv4: false,
|
|
validateStatus: statusCode => statusCode >= 200 && statusCode < 300
|
|
}
|
|
|
|
forEach(HEADER, h => (defaults.header[h] = {}))
|
|
|
|
export default defaults
|
|
|