Questions tagged [json]

JSON (JavaScript Object Notation) serves as a versatile data exchange format that can be easily understood by both machines and humans. Please refrain from employing this label when referring to native JavaScript objects or JavaScript object literals. Prior to seeking assistance, ensure the validity of your JSON through an esteemed validator like JSONLint (https://jsonlint.com).

Encountering an 'undefined' error while attempting to showcase predefined JSON data on an HTML webpage

As I try to display the predefined JSON data from https://www.reddit.com/r/science.json on an HTML page, I keep encountering the message "undefined." Below is a snippet of my HTML code: $.getJSON('https://www.reddit.com/r/science.json', funct ...

Special characters in JSON response

I received a JSON from an API with characters "\ u0083", "\ u0087d" and "\ u008d". I tried changing the encoding to utf-8 and ISO-8859-1, but without success. Can anyone help me out with this issue? It's important to note that the API c ...

Decoding JSON data into Java objects with RestTemplate and Jackson

I'm facing some challenges with deserializing JSON into Java objects within a Spring Boot 1.5 application using Jackson. Below is an example of the JSON response, which is an array containing a single JSON object with nested attributes: [ { "deploy ...

Removing unnecessary keys from intricate JSON data (with the use of pure JavaScript)

I've experimented with various methods to dynamically parse and remove keys with empty values from a JSON file using JavaScript. Currently, I can successfully delete non-nested keys, except for empty strings that have a length greater than 0. My main con ...

Generating an interactive table using JSON with Angular 5

Can a dynamic table with dynamic columns be created based on a JSON object using Angular 5? If yes, how? The API response includes the following JSON: { "ResponseStatus": true, "ResponseData": [ { "Parent": "Company 1", ...

What is the best approach to extract information from this JSON Pokemon Dictionary using the Pokemon API in Swift 3?

I am facing an issue concerning the parsing of JSON data from the latest version of the Pokemon API. Specifically, I am having trouble extracting the values of the "name" within the "type" key. Here is an example of the JSON: "types": [ { "sl ...

Performing a PHP select operation to extract a string for use in a mathematical problem, extracting data from a JSON decoded string, and subsequently

When passing the number 1 from my javascript file as $played = JSON decode, I find myself questioning whether my Select query is functioning correctly or if my math is simply incorrect. PHP is a relatively new concept to me, and I am unsure if I can rename ...

The use of res.send(status, body) in Express is now deprecated, as it does not work even after making changes to the expression. It is recommended

I'm encountering an issue while attempting to return a JSON in response to my Express App POST request. The error message I received is "express deprecated res.send(status, body): Use res.status(status).send(body)", despite making the suggested change, th ...

Spring JSON Neo4j is a powerful combination for building robust

Imagine a scenario where there is a Person node with 3 hobbies: Peter -> Hockey Peter -> Soccer Peter -> Basketball When querying the data from a string using Neo4jRepository: interface PersonRepository extends Neo4jRepository<Person, Long>{ ...

Is it possible to search and index nested object keys in JSON using PostgreSQL?

If my database table 'configurations' contains rows with a 'data' column in JSONB format like the example below: { "US": { "1234": { "id": "ABCD" } }, "CA": { ...

There was an issue trying to access the JSON file, as it seems that string indices

I am struggling with accessing items from a nested json file. Can someone provide some guidance? intents = {"intents": [ {"tag": "greeting", "patterns": ["Hi", "Hey", "Is anyone there?", "Hello", "Hay"], "responses": ["Hello", "Hi", "Hi there ...

Using D3.js to plot data points on a topojson map's coordinates

Having difficulty converting latitude and longitude coordinates to "cx" and "cy" positions on my SVG map created with d3 and topojson. Despite researching solutions online, I am unable to successfully implement the conversion process. Each time I try to co ...

Generating a compilation from a variety of JSON documents

I have a goal to compile a corpus containing the content of various articles stored in JSON format. These articles are spread across different files named after the year they were published; for instance: with open('Scot_2005.json') as f: da ...

Integrating HTTP JSON responses into HTML using Ionic 2, Angular 2, TypeScript, and PHP: A comprehensive guide

Currently in the midst of developing my first Ionic 2 app, however, my understanding of typescript is still limited.. I aim to execute the authenticate() method within my constructor and then to: Retrieve the entire JSON response into the textarea and/o ...

Exploring the Android JSON object

After downloading a JSON file, I found the following structure: { "options": { "toolbar": "1", "full": "1", "exit": "0", "about": "0" }, "general": { "versioncontrol": "1.0" }, "companydetails": ...

Experiencing troubles with NSJSONSerialization. An erroneous JSON object has been transmitted to the

Within my xcode project, I have implemented a functionality that involves sending a post request with JSON data to an API. To achieve this, I am utilizing the Unirest library: NSDictionary *jsonObj = @{@"access_token": accessToken}; UNIHTTPJsonRespon ...

Create a JSON object representing a view

Working on Rails 4 and delving into the world of AJAX for my controller actions. Here's what I've come up with: def create @client = Client.new(client_params) if @client.save render :json => {:result => 'success' } else re ...

Learn how to create a PHP activity feed that functions like Facebook, and discover the best methods for converting JSON responses into HTML

We are currently working on a website that functions similarly to Facebook, specifically focusing on the activity feed. To load the user's activity feed, we use AJAX to send a request to a PHP file which then processes the logic and returns the values ...

Parse the JSON object from the request when the content type is set to 'application/x-www-form-urlencoded'

I have an integration with a payment service, and they sent me a request using cURL like this: curl -d '{"merchantAccount":"pipedrive_youscore_rubicon_ltd","orderReference":"WFP-BTN-7181819-635e48482b33d"," ...

Utilizing multiple UILocalNotifications simultaneously

Hey there, I've encountered an issue with using UILocalNotification. I'm receiving notifications from a server and storing the data in a MutableArray. Here's a snippet of what it looks like: idnoty * id of notification titlenoty * title of ...

What is the best way to accurately parse a Date object within a TypeScript class when the HttpClient mapping is not working correctly?

Task.ts: export class Task { name: string; dueDate: Date; } tasks.service.ts: @Injectable() export class TasksService { constructor(private http: HttpClient) { } getTasks(): Observable<Task[]> { return this.http.get<Ta ...

`Is my JSON contact list missing after running `npm build` in React?`

After creating and deploying my React Web App (NodeJs) online, I noticed that the contact form successfully uploads data to my JSON database using fetch post (localhost:3001). However, when trying to locate the database file after running npm run build i ...

What is the best way to access nested JSON array data that includes varying key names and content?

In my current project, I am trying to extract data from a JSON array. Here is my approach: Below is the jQuery/JavaScript code I used to generate and retrieve data, particularly focusing on the nodes object which determines different layouts: var getPost ...

Transform Dynamic Array to JSON structure

I am currently developing a feature in my SvelteKit application that allows users to create custom roles for themselves. Users can input a role name and add it to an array, which is then displayed below. https://i.stack.imgur.com/oUPFU.png My goal is to ...

Angular proxy - Syntax error found in proxy configuration file: proxy.conf.json

My Angular 6 setup is configured to make HttpRequests, but I encountered a problem that requires me to run them through a proxy. To address this issue, I created a proxy.conf.json file next to my package.json: { "/loans/": { "target" : "https://api. ...

Using Kotlin to work with JSON strings that contain line breaks and variables

In need of help adding linebreakers to a JSON string for improved readability. val myString = "some string" val myObjectJson = ` { "example1": "value", "example2": $myString }` This will allow me to utilize ...

Discovering a way to extract all information from a JSON POST request using curl

Exploring the open data project on spogo.co.uk (Sport England) has been quite engaging. For a search example, check out: https://spogo.co.uk/search#all/Football Pitch/near-london/range-5. I've been experimenting with Cygwin and CURL to POST JSON data to ...

Utilizing Kendo UI Jsonp in conjunction with a WordPress json plugin: A comprehensive

Issue at Hand: My goal is to modify a kendo UI data-binding example to work with my own jsonp request. Description of the Problem: Starting from a data-binding example here, I have created this jsfiddle that demonstrates the desired functionality. To a ...

Exploring the power of AutoIt in iterating through a JSON array

I'm in need of assistance with automating a script to loop through an array and return a specific value from each object. [{"var1":"test1","var2":"test1"},{"var1":"test2","var2":"test2"},{"var1":"test3","var2":"test3"}] My goal is to extract the var ...

Error: The node is unable to parse JSON data through the API

After loading a JSON file as a string, attempting to parse it back to JSON and send it as a response: router.get('/todos', (req,res) =>{ let todos = fs.readFile('todos.json', 'utf8',(err, data) =>{ if (err) ...

Styling Result received from Web API call within an array

I am currently working on a function call that retrieves the result of an SQL query in an array format. app.get('/alluser', (req, res) => { console.log("All Users") user.getAllUsers(function (err, result) { if (!err) { ...

JSON response and service status in a WCF REST service

A WCF REST service is returning a JSON response as follows: { "categories": [{ "category_id": "10", "name": "Grocery", "freeQnty":"0", "prdcost":"100" }, { "category_id": "20", "name": "Beverages", ...

Is there a way to transform this nested json string into a Java object?

Help needed with converting a JSON string in a unique "special" format into a Java object. Struggling to access individual values such as the location or "resolved_at". Tried using GSON and JSONPOBJECT without success. { "result": { "upon_approval ...

Python OSError: [Errno 9] Issue with file descriptor encountered upon attempting to open large JSON file

Recently, I attempted to process a large json file (the Wikipedia json dump) in Python by reading it line by line. However, I encountered the following Error: Traceback (most recent call last): File "C:/.../test_json_wiki_file.py", line 19, in ...

Implementing JSON and JQuery to dynamically update ActionLinks in an MVC table

Here's the HTML code I'm using to display image actions inside a table element: <%= Html.ActionLink("[EditImg]", "Edit", new { id = item.GrossBaseReconId }, new { id = "BaseReconEdit", rowsid = item.GrossBaseReconId }).Replace("[EditImg]", "& ...

What is the best way to arrange this object alphabetically by name using Angular?

My client is in need of an AngularJS application that will interact with an API from an existing app. The API returns JSON data structured like the following: { "groups":{ "60":{ "name":"History" }, "74":{ "n ...

Performing a series of get requests in Angular 2

There is a configuration service that retrieves specific information from a JSON file. getConfiguration(key) { return this.http.get('./app/config/development.json').map(res => { this.result = res.json(); return this.result[key]; }) ...

What is the best way to convert a number into a string format for JSON formatting?

I am struggling with this code that I wrote to output data in JSON format for Google Chart. However, the issue I'm facing is that the return value for numbers is being converted into strings and cannot be read by Google Chart. $rows = array(); foreach($da ...

Guide on accessing JSON data from Google Insight API using PHP

I am interested in utilizing data from the Google Insight API by integrating it into a PHP page. (You can find more information in the documentation) Specifically, I am looking to understand how I could make use of the "numberJsResources" parameter provid ...

Why isn't my PHP code adding information to my MySQL database?

https://i.stack.imgur.com/a1eNG.jpgThe purpose of this script is to input data into a mysql database and generate JSON code for use in an Android application. However, during testing, the following result was obtained: Json Result after Testing On PostMan ...

How can I obtain tabular output for Boto3 | Python data?

When using the AWS CLI, you have the option to set the output format as either json or table. While I am able to obtain JSON output using json.dumps, is there a way to achieve output in table format? I attempted to use pretty table but did not succeed. ...

Generate a string that will be utilized to interpret a JSON response

I can't seem to extract a specific element from a json using a dedicated function. Can someone please assist me with this issue? Here is the fiddle that I have created for reference: http://jsfiddle.net/jonigiuro/N5TTM/2/ CODE: var data = { "results" ...

Developing a custom JsonMediaTypeFormatter for a Webapi platform

I'm currently working on developing a custom JSONMediaTypeFormatter to send some JSON parameters to a web API endpoint. The goal is to encrypt the data returned from the web API, which requires creating a customized media type formatter. Within my webapic ...

Demonstrate JSON data using ngFor loop in Angular

Need some assistance here. Trying to display data from a .json file using a ngFor loop. However, I keep running into the following error in my code: Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports bin ...

Creating a Slider with a Multitude of Images

I am working on a project to develop a gallery that pulls images from a JSON source. I have successfully implemented infinite scrolling to display the images on the first page. However, I am now facing a challenge when it comes to showing the selected imag ...

Building a JSON array within an array within an input in Rails 4

Currently, the content within my form is as follows: <%= f.input :document, collection: @documents, wrapper: false, label: false, input_html: {class: 'fleft mleft5'} %> This will result in a JSON array: [{ "document":"126" }] In My Controller, ...

Traverse a collection of nested objects containing arrays as their values

Consider the following object: { "apples": [ "one", "two" ], "oranges": [ "three", "four" ] } If I want to find the value four within this object, how can I do so efficiently? Would a loop work, like the one shown below? for (var ...

Mule Server 3.6 Connecting to Anypoint Studio Using the Request Connector

Is there a way to configure the Request Connector to send raw JSON data using the POST method? In my Set Payload transformer, I have the following code: #[{ "productId": #[sessionVars.productId] }] After running my Mule App, I encountered this error: E ...

I incorporated JSON into my codeigniter project as follows

Here is the code snippet $.post("color/color1", {color : e}, function(data) { var out=data + "<a class='one'>total</a>"; console.log(out); output.html(out); } This is the resulting content as displayed by the browser ...

Managing additional components in request JSON when communicating with DialogFlow, previously known as Api.ai

My current challenge involves enhancing the information sent in a JSON request from my application to DialogFlow. While I am familiar with triggering events to send data calling an intent through the method described in Sending Parameters in a Query Reques ...

Prepending a string to the key of a JSON object using JavaScript

Is there a way to add 'd:' before the key of a JSON object? Here is the JSON data: "data": { "aa": "value", "ab": "value" } The expected result should look like this: "d:data": ...

Javascript: Issue encountered while the page was loading

Whenever I make an API call, an error keeps popping up every time the page loads. I can't seem to figure out why it's happening. Can anyone shed some light on this? I've tried to include the link: https://i.stack.imgur.com/3Ul0S.png This is how I'm usin ...

Having trouble accessing a json file using Python Selenium Webdriver in Firefox?

Currently working on a research project where I am attempting to gather the json files from the French lobby register. However, I am encountering an issue with my selenium webdriver as I am unable to click the field. the button location can be found here. ...

Fill in datatable with information from a JSON array if there are missing values in certain columns

My goal is to populate a datatable in JavaScript. Currently, I am able to do so, but some of the last rows have blank columns which are populated first. I attempted to fill those blank columns, and then the data populates in order. Here is an example of my ...

Getting access to UBER's authorize API is a straightforward process that involves following a few steps to retrieve

I have been attempting to retrieve the code from JSON using a specific URL in Postman, unfortunately, I have not been successful in obtaining the code in JSON format. Click here for Uber login Furthermore, when I access this URL in my browser, I am redir ...

Looking to transform a list into JSON format using JavaScript?

I have a collection that looks like this: <ol class="BasketballPlayers"> <li id="1">Player: LeBron, TotalPoints: 28753, MVP: true</li> <li id="2">Player: Steph, TotalPoints: 17670, MVP: true< ...

Tips for accessing JSON data nested within another JSON object

Above is the JSON data I have: { "RestResponse" : { "messages" : [ "More webservices are available at http://www.groupkt.com/post/f2129b88/services.htm", "Total [249] records found." ], "result" : [ { "name" : "Afghanistan", "alpha2_ ...

Using JavaScript: Retrieve the URL from a JSON file and run it in the background

I am looking to make a JSON request using jQuery: $.getJSON('http://example.com/file.php', function(data) { //data }); An example of the JSON output: { "url":"http://example.com/execute.php" } Next, I want to silently execute the URL on the client s ...

What is the best way to save a dictionary with tuple keys into a .txt file?

Is it possible to save a dictionary containing tuples as keys into a .txt file? The program works fine with integer keys, but encounters an error when using tuple keys. dict = {(1, 1): 11, (2, 2): 22, (3, 3): 33, (4, 4): 44, (5, 5): 55, (6, 6): 66, (7, 7) ...

Blank display issue with jqGrid when using ASP.NET WebService as JSON data source

I'm stumped as to why this isn't functioning correctly. What's happening is that the end result is an empty grid with no JavaScript or XHR errors being reported. Here's the JavaScript code: var MyServiceURL = "MyService.asmx/"; funct ...

Exploring the functionalities of HTTP APIs through Python

As a newcomer to Python programming, I am unfamiliar with all the libraries required for the task at hand. I am interested in using Python to test some HTTP APIs. Specifically, I aim to leverage OAuth and make JSON calls. The relevant APIs can be accessed ...

How to Transfer Rows Between Two DevExpress Grids in ASP.NET Core

In my current ASP.NET Core project using Razor pages, I have incorporated two devexpress grids. The main objective is to select a row from one grid, click on the floating action button labeled "add", and have that selected row transferred to the grid on th ...

Struggling to retrieve JSON data from a URL and unsure how to manage errors and exceptions

Currently, I am attempting to retrieve JSON data from a specific URL within an Android application. The URL in question solely contains JSON information with no additional content. At this time, my main objective is to fetch the contents of the URL and sto ...

Processing JSON in a List

My struggle lies in processing a Scala list effectively: At present, I have a list that resembles the following (List(JString(2437), JString(2445), JString(2428), JString(321)), CompactBuffer((4,1))) After processing, my desired outcome is as follows: ...

Configuring the JSON response in ASP.NET Web API to adhere to JSON API standards

My ASP.NET Web API for Ember.js initially generated JSON output structured like this: [{"id":1,"name":"House of Crap","category":"Retail","street_name":"Washington Street"}, {"id":2,"name":"Sketchy Automotive","category":"Automotive","street_nam ...

Obtaining information from connected brushes in mlpd3, Bokeh, and Plotly using Python

In the following code, a 2x2 graph with 4 plots is generated. Data points can be selected using brushes. The main question here is how to retrieve the selected data points as a JSON array or CSV file. While this code uses mpld3 for this purpose, Bokeh offe ...

Generating a generic list in C# using JArray

Currently, I am facing a challenge with my dynamic import process that involves converting Json into an object array. My main obstacle lies in creating a List<> based on a string reference to the class object. To elaborate, I am retrieving json data from ...

Adding elements to a JSON array in Javascript

Seeking assistance on updating a JSON array. var updatedData = { updatedValues: [{a:0,b:0}]}; updatedData.updatedValues.push({c:0}); This will result in: {updatedValues: [{a: 0, b: 0}, {c: 0}]} How can I modify the code so that "c" becomes part of ...

Exploring Corona: Initial File Interactions

As I work on creating an application, I am trying to develop a function that can read sound and music states before the application starts. The challenge lies in the fact that there will be no recorded data the first time it runs. In my initial attempt, I ...

Can someone please provide me with the correct syntax for a jQuery AJAX PUT request that is JSON encoded?

Here is the ajax PUT request that I have written: jQuery.ajax({ url: url_lab_data+"backend/read/{\"f_anid\":"+anid+"}", type: "PUT", data: JSON.stringify({"read": 1}), ...

Looking to include an additional field in mongoose documents when generating a JSON object in a Node.js application?

var commentSchema = new Schema({ text: String, actions:[{actionid:String, actiondata:String}], author: String }) When retrieving the records, I require a count for action = 1. The desired outcome is to include this count as an additional key ...

Dynamic Data Visualization using ChartJS with MySQL and PHP

I'm trying to create a line chart using chartJs that will display MySQL data. Specifically, I would like to use PHP to push the MySQL data to the chartJs. Here is an example of the MySQL table: id | page_views | visitors | month | --------------------- ...

Utilize AngularJS ngResource to transmit JSON data to the server and receive a response

My Angular JS application requires sending data to the server: "profile":"OLTP", "security":"rsh", "availability":"4", "performance": { "TRANSACTION_PER_SEC":1000, "RESPONSE_TIME":200, "CONCURRENT_CONNECTION_COUNT":500, "STORAGE_SIZE": ...

The Jquery AJAX function encounters a 403 Forbidden error while making a web service call

I encountered an issue with a web page that includes an AJAX method. Here is the code snippet: $(document).ready(function() { $.ajax({ type: "POST", url: "http://www.webservice.com/blahblah.asmx/blahb123", ...

Exploring the Possibilities of Utilizing jqPlot with JSON Data

I've been working on retrieving a JSON string through an Ajax call in jQuery and trying to visualize that data in a bar chart using jqPlot. Although I found the JSON conversion code on a Stack Overflow post, I'm facing difficulties as it's not functioning ...