Need help with cross-request?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

YMFE
189 Stars 65 Forks 57 Commits 11 Opened issues

Description

A chrome extension that gives the html page cross-domain request capability.

Services available

!
?

Need anything else?

Contributors list

A chrome extension that gives the html page cross-domain request capability.

一个赋予html页面跨域请求能力的chrome扩展

https://chrome.google.com/webstore/detail/cross-request/cmnlfmgbjmaciiopcgodlhpiklaghbok?hl=en-US

Api

crossRequest( options )

Usage

  1. GET ``` crossRequest({ url: 'http://caibaojian.com/ajax-jsonp.html', method: 'GET', success: function(res, header){

    } }) ```

  2. POST

    crossRequest({
        url: 'http://127.0.0.1:3000/api',
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        data: {
            a: 1,
            b: 2,
            c: {
                t: 1
            }
        },
        success: function (res) {
            console.log(arguments)
        }
    })
    
  3. FILE upload

    crossRequest({
        url: 'http://127.0.0.1:8081/upload',
        method: 'POST',
        data: {
            name: 'hello',
            id: '19'
        },
        files: {
            file: 'fileId' //File Upload-Input dom id
        },
        success: function (res) {
            alert(res)
        }
    })
    

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.