Parse JSON data from a website with HTTP request with javascript

I’ve used package sniffer to get a specific endpoint, which gave me a direct JSON url. Now I want to get for all usernames from this JSON format.For eg. it goes like this: {“node”:{“id”:”1428809588″,”username”:”kafeterijabg”,”full_name”:”\u041a\u0430\u0444\u0435\u0442\u0435\u0440\u0438\u0458\u0430\u00ae”,”profile_pic_url”:”https://instagram.fbeg5-1.fna.fbcdn.net/vp/65f96409e2a6c5b9b72cda956aa0dfea/5E638B5F/t51.2885-19/s150x150/64620072_350924665805634_2914908438809018368_n.jpg?_nc_ht=instagram.fbeg5-1.fna.fbcdn.net”,”is_private”:false,”is_verified”:false,”followed_by_viewer”:true,”requested_by_viewer”:false,”reel”:{“id”:”1428809588″,”expiring_at”:1572193230,”has_pride_media”:false,”latest_reel_media”:1572095740,”seen”:1572031349,”owner”:{“__typename”:”GraphUser”,”id”:”1428809588″,”profile_pic_url”:”https://instagram.fbeg5-1.fna.fbcdn.net/vp/65f96409e2a6c5b9b72cda956aa0dfea/5E638B5F/t51.2885-19/s150x150/64620072_350924665805634_2914908438809018368_n.jpg?_nc_ht=instagram.fbeg5-1.fna.fbcdn.net”,”username”:”kafeterijabg”}}}} I’ve tried sending requests and parsing it to console but I’m getting “undefined”. function Get(yourUrl){ var Httpreq = new XMLHttpRequest(); Httpreq.open(“GET”,yourUrl,false);…

JSON data couldn’t be read

I am trying to replicate following GET request in my project: curl -XGET ‘https://api2.branch.io/v1/url?url=https://example.app.link/WgiqvsepqF&branch_key=key_live_kaFuWw8WvY7yn1d9yYiP8gokwqjV0Swt’ Here is my final code: if let url = URL(string: “https://example.app.link/WgiqvsepqF&branch_key=key_live_kaFuWw8WvY7yn1d9yYiP8gokwqjV0Swt”){ let urlRequest = URLRequest(url: url) URLSession.shared.dataTask(with: urlRequest) { (data, response, error) in if error == nil{ do{ if let dataReceived = data, let jsonData = try JSONSerialization.jsonObject(with: dataReceived, options: .mutableLeaves)…

Cannot read Arabic letters after reading JSON file

I am using this code to read a json.txt file which contains numbers and Arabic string : if let path = Bundle.main.path(forResource: “data”, ofType: “txt”) { do { let data = try Data(contentsOf: URL(fileURLWithPath: path), options: .mappedIfSafe) let jsonResult = try JSONSerialization.jsonObject(with: data, options: .mutableLeaves) if let jsonResult = jsonResult as? Dictionary<String, Any>, let person…

i need to get data from json but

i have an API that return data type of _HttpClientResponse cause i am using httpClient, i decode the result to string using the below var reply = await memoryResponse.transform(utf8.decoder).join(); when i print the result I/flutter (23708): String I/flutter (23708): {“results”: [{“IPAddress”:”192.1.1.1″,”Description”:”Windows 2016 Server”}, {“IPAddress”:”192.1.1.1″,”Description”:”Windows 2016 Server”},{“IPAddress”:”192.1.1.1″,”Description”:”Windows 2016 Server”}]} then decode it with json.decod var memJasonData…

How to loop nested json into ul li using ngFor in angular 7

I have a nested json,I need to append that json format into ul li tag using ngFor as per below output format,I can use ngfor loop but I am not getting how to use it.Here is the expected output(hardcoded) in html.Below is the code. home.component.html <div class=”col-md-3″ id=”leftNavBar”> <ul> <li class=”parentNav”>parent1</li> <li class=”childData”> <ul> <li>child11<span…

I can’t get data from an array embedded in json. Using retrofit and GSON

I’ve been trying to get data from the “content” array for several days now, but I get a null response My JSON: { “Magazines”:[ { “Title”:”someTitle”, “Year”:”2019″, “Description”:”someDescription”, “Type”:”anyType”, “Cover”:”http://img.timeinc.net/time/magazine/archive/covers/1956/1101560514_400.jpg”, “Info”:”infoAboutMagazine”, “Content”:[ { “ArticleTitle”:”someArticleTitle”, “ArticlePrice”:”101$” }, { “ArticleTitle”:”1.2)someArticleTitle”, “ArticlePrice”:”102$” }, { “ArticleTitle”:”1.3)someArticleTitle”, “ArticlePrice”:”103$” } ] }, { “Title”:”someTitle2″, … “Content”:[{ … }] } ] }…