1.0.11 • Published 5 years ago

axios-pomelo v1.0.11

Weekly downloads
13
License
ISC
Repository
-
Last release
5 years ago

Axios-pomelo

Fetch based tool to request data from browser and node.js

  • Make fetch requests from the browser

  • Make http requests from node.js

How to use

import axios from 'axios-pomelo';


axios.interceptors.request.use(function(config) {
    config.headers.token = 'token00001';
    return config;
});

axios.interceptors.request.use(function(config) {
    config.headers.aaa = 'aaabbb';
    return config;
});

axios.interceptors.response.use(function(config) {
    config.headers.test = 'aaabbb';
    return config;
});

axios({
    url: '/test.json',
    method: 'GET',
    headers: {
        a: 'b',
        mode: 'no-cors',
    },
    data: JSON.stringify({"page": 1, "maxResult": 10})
}).then(res => {
    console.log(res);
});

axios.create({
    url: '/test.json',
    method: 'GET',
    headers: {
        a: 'b',
        mode: 'no-cors',
    },
    data: JSON.stringify({"page": 1, "maxResult": 10})
}).then(res => {
    console.log(res);
});
1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago