2016-02-22 6 views

risposta

7

Sì, lo è. Devi usare fetch per usare la tua API. La cosa più importante è che la tua API restituisca JSON (idealmente) o un'altra risposta che può essere gestita da Javascript (HTML, XML, ...).

Ecco un piccolo esempio su come recuperare i dati dall'API in React Native.

fetch('http://your-django-api-url.com/endpoint?query=id') 
.then((response) => { 
    return response.json() 
}) 

Maggiori informazioni qui: https://facebook.github.io/react-native/docs/network.html

Problemi correlati