1.0.11 • Published 6 years ago

axios-pomelo v1.0.11

Weekly downloads
13
License
ISC
Repository
-
Last release
6 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

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago