Giter Site home page Giter Site logo

axios-jsonp's Issues

jsonp response should be in `data` field

We use axios.get like this

const response = axios.get<ResponseType>(...)
const data = response.data

But jsonp response doesn't have data field and we should use it like this

const data = axios.jsonp<null, ResponseType>(...)

Can you bring it to universal API?

Got `MIME type ('application/json') is not executable` when perform JSOP request

Got this error when using jsop :

Refused to execute script from 'https://sites.google.com/macros/exec?service=AKfycbx_-gZbLP7Z2gGxehXhWMWDAAQsTp3e3bmpTBiaLuzSDQSbIFWD&menu=nama_produk&query=abc&callback=__jp0&_=1513598105820' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.

this is snippet my code :

axios
          .jsonp(path)
          .then((response) => {
            console.log('Success when getting data via API ', response)
          })
          .catch((error) => {
            console.log('Error when trying to get via API ', error)
          })

Trying to get in touch regarding a security issue

Hey there!

I'd like to report a security issue but cannot find contact instructions on your repository.

If not a hassle, might you kindly add a SECURITY.md file with an email, or another contact method? GitHub recommends this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.

Thank you for your consideration, and I look forward to hearing from you!

(cc @huntr-helper)

JSONP baseURL not work

I have the following Axios Service API:

import axios from 'axios-jsonp-pro'

const api = axios.create({
    baseURL: 'http://teste.com/api/',
    headers: {'X-Custom-Header': 'foobar'},
  });

export default api

When making the call using JSONP:

api.jsonp('issues.json')
      .then(function (response) {
        console.log(response);
      })
      .catch(function (error) {
        console.error(error);
      });

I have the return ..
Uncaught SyntaxError: Unexpected token '<' issues.json?callback=__jp0&_=1569598044015:1

and doesn't recognize API baseURL

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.