import digestFetch from 'react-native-digest-fetch';
import config from './config';
class Fetch {

    async callGetApi(url, params) {
        try {
            const response = await digestFetch(url + "?" + new URLSearchParams(params), {
                method: "GET",
                headers: {
                    'Accept': 'application/json',
                },
                username: config.username,
                password: config.password,
            });
            const data = await response.text();
            return data;
        }
        catch (err) {
            console.log(err);
        }

    }

}

export default Fetch