first of all, I need to access my api in localhost I've tried everything but why it doesn't works (?)
first, I set my axios setup like this:
import axios from 'axios';
export default axios.create({
baseURL: 'http://localhost/github/xxxx/index.php/api',
headers: {
'Authorization': 'Basic username pass',
'Content-Type': 'multipart/form-data'
}
});
but doesn't work,
Then I try this :
import axios from 'axios';
export default axios.create({
baseURL: 'http://192.xxx.xx.142/github/xxxx/index.php/api',
headers: {
'Authorization': 'Basic username pass',
'Content-Type': 'multipart/form-data'
}
});
the baseURL is from IPv4 Address in ipconfig/all
but doesn't work, Then I've read about android emulator they said " if u want to use localhost then u need to set url to 10.0.2.2 like this :
import axios from 'axios';
export default axios.create({
baseURL: 'http://10.0.2.2/github/xxxx/index.php/api',
headers: {
'Authorization': 'Basic username pass',
'Content-Type': 'multipart/form-data'
}
});
but still not working :(
and the error of message always like this : " Error while reading multipart response "
how to fix this ? :(
I'm building the api using rest_api plugin codeigniter
thank you before