React Native
React Native
Shopify Basic Authentication: Get List of Products
See more Shopify Examples
Demonstrates how to send a simple HTTP GET request with Basic authentication to get a list of products.Chilkat React Native Downloads
import { Http } from '@chilkat/react-native'
async function chilkatExample() {
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
const http = new Http();
// Use your Shopify store's Admin API key and password.
http.login = 'admin3_api_key';
http.password = 'admin3_password';
http.basicAuth = true;
let jsonStr: string;
try {
jsonStr = await http.quickGetStrAsync('https://mystore.myshopify.com/admin/api/2020-07/products.json');
} catch {
console.log(http.lastErrorText);
return;
}
console.log(`Response status code: ${http.lastStatus}`);
console.log('JSON response:');
console.log(jsonStr);
}