![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Promise based HTTP client for the browser and node.js wrapper axios and add jsonp support
Using npm:
$ npm install @allex/io
//test in browser with karma
$ npm run test
//test in node with mocha
$ npm run node-test
$ npm run build
Performing a request
io[method](url,data,success,fail,config)
io.get(
// request url
'/user',
// optional request query data or request data
{ID: 12345},
//handle business success
function (data) {
console.log(data);
},
//handle business fail when code is not false value or server error
function (error) {
console.log(error)
},
//extra config or axios config
{
// use application/json with modern api
emulateJSON:false
})
//handle success in promise
.then(function (data) {
console.log(data);
})
//handle error in promise
.catch(function (error) {
console.log(error);
//error.$ is origin error throw by axios
console.log(error.$);
});
response data is formatted as
{
code:0,
data:"data from server"
message:"message from server"
}
response error is formatted as
{
code:"error code",
data:"error data from server",
message:"error message from server",
$:axios throw error
}
see https://github.com/mzabriskie/axios#request-config
{
// use application/json with modern api
emulateJSON:false
}
//the axios instance is in io.fetch and origin axios is in io.axios
//if you want to use interceptors
// request interceptor
io.interceptors.request.use(function (config) {
// Do something before request is sent
return config;
}, function (error) {
// Do something with request error
return Promise.reject(error);
});
// response interceptor
io.interceptors.response.use(function (response) {
// Do something with response data
return response;
}, function (error) {
// Do something with response error
return Promise.reject(error);
});
create instance with config
const instance = io.create({
baseURL:"http://www.analysys.cn",
emulateJSON:false
})
set default config in all instance
io.config.emulateJSON = false
for more detail see http://git.analysys.cn/npm/io/tree/master/test
FAQs
generic io toolchain both for browser and node
The npm package @allex/io receives a total of 1 weekly downloads. As such, @allex/io popularity was classified as not popular.
We found that @allex/io demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.