Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [{"id":296,"nama":"Appetizer"},{"id":295,"nama":"Bahan"}]
- var obj = JSON.parse(response);
- let str = '[{"id":296,"nama":"Appetizer"},{"id":295,"nama":"Bahan"}]';
- try {
- let obj = JSON.parse(str);
- } catch (ex) {
- console.error(ex);
- }
- JSON.stringify(obj)
- try {
- let response = await fetch('http://'+this.state.url+'/web_services/login_json/new.json', {
- method: 'POST',
- headers: {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify({
- erzap: {
- username: this.state.username,
- password: this.state.password,
- }
- })
- });
- let responseJson = await response.json();
- AsyncStorage.getItem('kategoris').then((value) => {
- this.setState({
- 'kategoris': value,
- });
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement