getting error : fetch errorSyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data in react ajax call

when i try to run ajax call in react js, i am getting error, fetch errorSyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data here i have placed my ajax call, can anyone please look it in my code and help me to resolve this issue ? fetch(‘https://randomuser.me/api/?results=5’, {…

how to convert JSON data into dataframe?

I got a JSON data like this: jsonData = { “0”:{ “columnA”:”a”, “columnB”:”b” }, “1”:{ “columnA”:”c”, “columnB”:”d” } } how do I convert it into a data frame like this: rowData 0 {“columnA”:”a”,”columnB”:”b”} 1 {“columnA”:”c”,”columnB”:”d”} Here’s what I tried: df = pd.DataFrame({‘rowData’: jsonData}) but I got an error: If using all scalar values, you must…

JSON:API – Filter Nodes by Paragraph user reference

Say you have a content type Exercise which has a (Related Users) paragraph field. In turn, Related Users has a user reference field: (content type) exercise –> (paragraph) related_users –> (user) user I want to filter all Exercises with a certain related user: /api/node/exercise?filter[field_related_users.field_user.name]=some_user But it returns empty data: “data”: [],. Same if tried with…

How to read .json to output an specific number?

Hello I’ve been using this: curl -s “http://api.openweathermap.org/data/2.5/forecast?id=6361046&APPID=6be5e3a6e62680c28044791e8fc7b568&units=metric” -o ~/.cache/weather.json to write a weather.json file in my cache folder. the output is this. the problem is that it’s only in 1 line and I’m trying to use grep to get an output of the icon value of today: {“cod”:”200″,”message”:0,”cnt”:40,”list”:[{“dt”:1574629200,”main”:{“temp”:12.8,”temp_min”:12.8,”temp_max”:13.07,”pressure”:1020,”sea_level”:1020,”grnd_level”:1012,”humidity”:82,”temp_kf”:-0.27},”weather”:[{“id”:804,”main”:”Clouds”,”description”:”overcast clouds”,”icon”:”04n”}] which in this case is…

Nested object inside JSON in React

Sory, I am new here. I generate Data object in ASP .Net Core and it is avaliable through GET GetData: using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; namespace ReactImport.Controllers { [Route(“api/[controller]”)] [ApiController] public class GetPostExampleController : ControllerBase { private Data data; public GetPostExampleController() => data = new Data(); [HttpGet(“GetData”)] public Data GetData() { return data; } } [JsonObject]…