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 a SyntaxError with the message 'Unexpected token' while trying to require a module in strict mode from JSON at position 0

Within the index.js file, the following code is present: 'use strict'; const config = require('./config'); In the config.js file, the code looks like this: 'use strict'; const config = new function() { this.port = 3000; this.redirectUri = "http:// ...

N8N: Deleting JSON Key from Output

Is it possible to remove the json key in my output file? I am unsure of the best approach to achieve this. I would like to return an array of data with all values, not just one value. If you want more information, here is a link to my N8N post: Manipulate ...

Searching through a JSON object on a Laravel web page using JavaScript or AJAX for live filtering purposes

After diving into AJAX and JavaScript, I find myself needing to replace some outdated Angular functionality on our Laravel site. The specific task at hand is creating a live search filter for a page with a static header search bar. The main requirement is ...

Just starting out with d3 and struggling to display a graph using JSON data

I'm completely new to using d3 and struggling with creating a line graph from JSON data. Within my ReportBucketDAO.java file, I am generating JSON output based on my database records. while (rs.next()) { String currency = rs.getString("currency"); ...

Issue encountered when converting java.util.Collections$UnmodifiableRandomAccessList to com.google.protobuf.Message

After receiving a gRPC response in the form of a Dynamic Message with nested fields, I am attempting to extract the top-level field first and then accessing the nested fields. Here is an example of how the response is structured: field1 { key1: "val ...

Search for a substring in JSON using Python

Currently, I am faced with the challenge of extracting two pieces of information from a lengthy JSON file using Python 2.7. The structure of the JSON data is as follows: { 'device': [ { 'serial': '00000000762c1d3c', 'registered_id': '01 ...

Extracting a token from a JSON response using Python

I'm currently delving into Python and exploring the API for MediaFire to automate some basic tasks. However, I've hit a roadblock after sending a POST request to obtain the Session Token. Extracting the token from the response is where I'm facing confusion ...

Experiencing a result of NaN following a mathematical operation on variables

While working with an array obtained from a JSON response, I am encountering NaN after performing addition operations. var a = new Array(); var b = 0; var c = 0; alert(b); for (var x = 0; x < length; x++) { a[x] = response.data[x] } for (var i = 0; ...

Retrieving values from Restful webservices has never been easier than now

Currently, I am working on a small project that involves retrieving a list of values from my webservice: @GET @Path("/string") @Produces({"application/xml", "application/json"}) public List<String> test2() { List<String> list = new ArrayLi ...

JToken.GetToken Comparable in C#

I am looking for a way to remove the outer node of a JSON using tools within the .NET Framework (C#). Here is an example: { app: { ... } } Is there a method to strip away the outer node so that we are left with only: { ... } PLEASE NO ...

Retrieving a variable value from an AJAX call for external use

Looking for a solution to pass the generated JSON response from an ASMX web service accessed via AJAX to an outside variable in another function. Below is the code snippet for reference: function setJsonSer() { var strWsUrl = 'htt ...

Retrieve information from a .json file using the fetch API

I have created an external JSON and I am trying to retrieve data from it. The GET request on the JSON is functioning correctly, as I have tested it using Postman. Here is my code: import "./Feedback.css"; import { useState, useEffect } from " ...

Are Java classes specifically designed to handle the responses from Camunda's Rest API available?

Currently, I am setting up REST calls from Spring to my local camunda instance using the camunda rest api. This is how I've configured it: I have launched a local camunda docker container on localhost:8080 following this link: (I have verified t ...

Several attributes in the JSON object being sent to the MVC controller are missing or have a null

I am facing an issue while passing a JSON object to my MVC controller action via POST. Although the controller action is being called, some elements of the object are showing up as NULL. Specifically, the 'ArticleKey' element is present but the 'MeasureDef ...

Is there a way to initiate a JSON POST request from an iOS gadget and direct it towards an ASP.NET URL?

I am currently developing an application that requires data sharing with a windows server. After researching various examples online, I have come up with the following implementation below. Although both the iOS code and web-service are functioning properl ...

I am encountering an issue trying to save and load app settings using JSON. The error message says that it is unable to convert from 'System.Text.Json.JsonElement' to 'System.Collections.Generic.List`1[System.String]'

My attempt to save application settings data in JSON format for easy readability and retrieval is not going as planned. I am encountering an error while trying to reassign the values of lists stored in a ListDictionary. The strategy involves organizing di ...

Guide on embedding PHP/MYSQL array into an independent JavaScript document

I'm looking for guidance on how to insert an array from a PHP MySQL page into a separate JavaScript file. Can someone please help me with indicating where to include the PHP URL and provide the correct format for the PHP array code in order to achieve ...

Encountering a java.lang.OutOfMemoryError when trying to construct a JSON object in Java/Android development

For my project, I am fetching JSON data from a public database through the URI , and this dataset contains up to 445454 rows. The code snippet below outlines how I'm constructing the JSON object for this extensive dataset. HttpGet get = new HttpGet(uri ...

Displaying properties of objects in javascript

Just starting with JavaScript and struggling to solve this problem. I attempted using map and filter but couldn't quite implement the if condition correctly. How can I find the records in the given array that have a gender of 0 and color is red? let s ...

Generating a package.json file that includes a comprehensive list of all development dependencies

My Inquiry I've been pondering whether it's possible to include all the necessary devDependencies within the package.json file generated by running npm init in the Terminal for Gulp projects. Can these dependencies be pre-listed in the file instead of hav ...

Utilizing JSON and AJAX to mine data from databases

I've been working on creating a basic "search" box using Javascript, AJAX, PHP, and JSON. I'm focusing on the "world" database that I downloaded from the MySQL website for this particular project. I've hit a roadblock when trying to retrieve ...

Problem encountered when transferring JSON data to PHP for file writing

After spending numerous hours researching potential solutions, I still can't seem to fix the issue at hand. Admittedly, I am fairly new to PHP, so it's possible that I am overlooking a small detail. The problem lies in the fact that I have a form within my ...

Unable to Show the Contents of the Item - AngularJS

I'm in the process of developing an application that will showcase job details within a modal window based on the selected template. To achieve this, I've integrated ui.bootstrap and ui.router. However, I'm encountering difficulties in displ ...

What is the optimal method for importing a JSONObject from a JSON file?

Is there a more efficient way to load a JSON file into a JSONObject? Currently, I am utilizing json-lib for this task. Here is my current approach which results in an exception being thrown: XMLSerializer xml = new XMLSerializer(); JSON json = xml.readF ...

Using the FileInput Shiny App to Upload JSON Files

I'm currently working on developing a shiny app that can load and display data from a .json file in a table format. I've attempted to import the data and present it using DataTable along with the fromJson function from Json Lite. options(shiny ...

Bringing JSON information into Java without the need for escape characters

I'm currently fetching Json data from a .json webpage using an HttpResponse in Java. The code snippet String Json = EntityUtils.toString(response.getEntity()) is then used to store the Json data as a String. Unfortunately, this process alters the format o ...

Arrange a JSON file by organizing a key located within an array of dictionaries using Python

Here's a structure that I am working with: [{ "name": "apple", "price": "5.0", "record": [ { "id": "008", "time": 1465689600 } ] },{ "name": "banana", "price": "9.0", "record": [ ...

Transform a JSON dataset into a visually appealing PDF document using mPDF

My current project involves converting a JSON file to a PDF using mPDF. However, I'm encountering an issue where the JSON table is not being displayed in the HTML after running the PHP code. Instead, only one empty PDF page is generated. UPDATE: I have ma ...

Is there a way to send a multi-dimensional array using jQuery ajax?

I am encountering an issue with posting an array as a JavaScript variable {{0,0},{1,1},{2,2}} using JSON.Stringify. Whenever I try to post it, I receive an internal server error 500. Can someone please advise on how I can successfully post and utilize this ...

Breaking down this JSON (array)

Greetings! I have a section of JSON data that requires parsing, and I have condensed it for better visibility. [ { "trends": [ { "name": "#CyberMonday", "url": "https://twitter.com" }, { "name": "#Bl ...

Utilizing Jackson in Java Play Framework 2.3 to stream JSON data

I am wondering if there is a way to stream Json in my API response. After learning how to read and write a json file using the Jackson library from this example: Now, in the Play Framework, I want to know how I can stream my response or essentially retur ...

Having trouble with error code JSON Parse error: Struggling to understand JSON formatting

I am encountering a frustrating issue with a JSON parse error. I can't seem to determine whether the web service is faulty or if there's an issue with my fetch code. When testing the web service on Postman, it returns two objects. However, whenev ...

Displaying nested object properties in HTML through iteration

What is the correct way to access them if item.NestObj.textpropertyVal is showing incorrect? success: function(data){ var html = ""; $.each(data.mainOutterObj, function (index, item) { html += "<ul&g ...

Assistance needed with sending JSON data to a PHP server using the POST method

I am attempting to transfer JSON data from an HTML form to a PHP server using the POST method. The issue I am encountering is that my code always ends up in the fail block within the callback function. Despite this, the Firebug console (ctrl+shift+J) does ...

Dealing with Expressjs error messages: When sending data that is strictly a string,

It has been quite challenging to find information on this topic, as most inquiries involve incorrectly serialized objects. I am attempting to send a string, not an object. Here is the request right before it is sent off. The payload can be properly handle ...

What is the process for combining two values from a JSON-array in a specific sequence?

Currently, I am utilizing PostgreSQL 9.5 and have a table containing JSON arrays with JSON objects structured like so: [] [{animal:cat}, {plant:sunflower}, {car:mercedes}] [{animal:dog}] [{animal:dog}, {car:audi}] [] The goal is to present a table that m ...

jsTree open_all not triggering consistently

Upon receiving x number of projects and their corresponding directory structure from the server in a single AJAX call, the connection is disconnected from the server. Subsequently, all operations must be carried out from the browser. After loading the pro ...

The JSON output is not displaying correctly

I've been attempting to utilize JSON.stringify in order to format my json object for better readability. However, it doesn't seem to be working as expected. Can someone please offer assistance in identifying what I might have done incorrectly? ...

Guide to Deserializing a JSON Object in Windows Phone 8.1

Can anyone help me with an issue I'm facing? When I deserialize a JSON object and bind it to my properties, the properties show null values. Here is my code: string s = "{\"response\":{\"status\":\"fail\",\"content& ...

Ways to insert user data into a hidden input field

I am facing an issue with the input field on my website. Users can enter their desired input, and this data is copied into a hidden input field. However, the problem arises when new data replaces the old data. This is where I copy all the data: $('# ...

Sending a request via AJAX to retrieve a complicated object

Programming Environment: ASP.NET, jQuery Below is the AJAX call I am using: var tempVar = JSON.stringify({plotID:currentId}); $.ajax({ type: "POST", url: "testPage.aspx/getPlotConfig", data: tempVar, contentType: ...

Converting PHP cURL request to receive JSON response

My current setup involves a PHP file that uses cURL to return data to the client. Recently, I made changes on the client side to handle JSON responses instead of HTML, which resolved some issues. However, now I am interested in returning the data as a JSON ...

Failed to load JSON data from the factory

Recently, I started learning AngularJS and have been struggling to fetch JSON data from a factory. The error message I keep getting is not very helpful: TypeError: Cannot read property '1' of null This is the module I am working with: var app = angular. ...

Add a fresh key to a pre-existing array within an object

I have a JSON array that I need to modify by adding a new key. Here is the current structure: stdClass Object ( [set] => Array ( [0] => stdClass Object ( [name] => agenda ...

Trouble displaying data with Angular 6 JSON object pipe

Having an issue with displaying tasks from a MongoDB project schema in HTML. The tasks are stored in a nested array and I want to show the task name and description. Here's the code: <div class="card-body"> {{project.taskName | json}} </ ...

Change a CSV string into a JSON array and assign it to a variable

I am working with JSON data that looks like this: [ { "Title": "PAGE A", "Users": "USRA" }, { "Title": "PAGE B", "Users": "USRA,USRB" } ] What is the most efficient method to convert the fields containing " ...

Obtain data with matching JSON values in a REACT application

Recently, I received a JSON file that looks something like this: [ { "symbol": "A", "name": "Agilent Technologies Inc", "exchange": "NYSE", }, { "symbol": "AAC ...

The jquery datatable is not properly receiving the Json response

I am looking to dynamically populate a jQuery datatable with different sets of data based on the request parameter. I have received the object JSON response, but I'm encountering an error when trying to bind it to the datatable. DataTables warning: t ...

What is the process for filtering a JSON column in Postgresql?

Imagine we have a basic table, id - user identification rooms - JSON type indicating the number of rooms the user is looking for. id rooms 1 ["3.0","4.0"] 2 ["3.0"] 3 ["1.0"] If I want to filter users searching for 3 rooms, how can I do that? I am aw ...

The third page of Reddit's JSON data on display

When utilizing the Reddit api, I have found a way to retrieve the json of a page. I have successfully done this for the front page, but now I am wondering how to obtain the json for the third page without navigating through the second page. Is there a met ...

Send a PHP array back to jQuery AJAX and dynamically populate a list using conditional statements

Looking to create a dynamic contact list that can be sorted using AJAX. When selecting one of the 3 menu options, a new list with updated information should be displayed. I've been doing some research but haven't come across useful information o ...

Tips for styling the output of var_dump with an array

I currently have a script that retrieves an array from an API URL. <?php $url = 'https://api.example.com/v1/w'; $data = file_get_contents($url); $data = json ...

Rails gives a response of HTML when angular sends a resource.get request

Having trouble with Rails 4 responding to an angular resource.get request with HTML instead of JSON. The code snippet for the javascript is as follows: $resource("/questions/:id", {id: "@id"}}.get({id: 16}); The server error occurs because it cannot loc ...

Leveraging the power of MySQL and PHP to handle nested JSON data in AngularJs with ng-options

Can someone please guide me on how to generate nested JSON data using MySQL and PHP in Codeigniter? I am looking to structure my data in the specific format shown below. $data = { 'India': { 'Andhra Pradesh': ['Vijay ...

Is there a way to decode and convert the nested JSON structure into a readable table format using Python?

Currently, I have a dataframe with a column named test_col that contains JSON structures. The data within the lineItemPromotions object can be quite complex, with nested JSONs and varying numbers of items. My goal is to unnest these structures in order to ...

The duration for which an API Access Token remains valid is extremely brief

I recently started working with APIs and my current project involves using the Petfinder API v2 to develop a website that allows users to search for adoptable animals. The API utilizes OAuth, requiring a key and secret to obtain a token via CURL. However, ...

Using ASP.NET MVC 5, connect JSON to the action parameter

I encountered a problem while developing a basic app using ASP.NET MVC 5. The issue arose when I attempted to convert JSON into an entity. Below is the code snippet: Entity public class PlayListViewModel { public PlayListViewModel() { Track ...

Converting the HTTP response data from a Node server into a JSON file mapping

I am currently developing a solution where the web server, specifically using node with express, will utilize the request package to retrieve data from a web API. Upon receiving the data (which may include validation error status codes), it needs to be com ...

Tips for importing a .geojson document in TypeScript using webpack?

I am trying to extract data from a .geojson file but faced some challenges while attempting two different methods: const geojson = require('../../assets/mygeojson.geojson'); The first method resulted in an error message stating: Module parse failed: Une ...

Statistics Sweden SCB API call was made, but unfortunately, no data was retrieved

I am having trouble accessing the actual values of the data in my table, as all I can see is the dates in the JSON output generated. The specific link I am using is: "http://api.scb.se/OV0104/v1/doris/en/ssd/START/FM/FM5001/FM5001A/FM5001SDDSPM" ...

Retrieve Json data from an external API in Angular by utilizing the HttpClient module

Being a novice in angular, I am experimenting with fetching data from an external API. Although I managed to retrieve the data successfully on the console, I encountered errors when attempting to display it on the screen. Below are the details of my setup: ...

I would like to know the best way to compare two JSON data sets, filter out any matching data, and then store the remaining results

To efficiently extract all Post Titles from a JSON API, I am utilizing another JSON API of users to further retrieve the count of comments for each Post. Here are the APIs being used: API for USERS: http://jsonplaceholder.typicode.com/users API for POSTS ...

Encountering a parse error when parsing JSON using getJSON

Looking to incorporate some jquery.gantt and it requires data in JSON format. The documentation can be found at () Here is the jQuery code snippet: $(".gantt").gantt({ source: basePath + "system/print_gantt_project_data.php?project_id=" + pro ...

Connection error between frontend and backend was encountered

Whenever I try to register on my page and connect it to the database, I encounter an error after pressing the sign-in button... "Uncaught (in promise) TypeError: Converting circular structure to JSON --> starting at object with constructor 'HTM ...

Enhancing Form Fields Dynamically using AJAX and JSON

I'm trying to update specific fields in my form after fetching data from a database using AJAX and JSON. Here is the code snippet: In my form: <div class="form"> <?php $form=$this->beginWidget('CActiveForm', array( 'id'=>'anagrafica- ...

Determine changes in data retrieved from a JSON file using React

I've been working on a cryptocurrency app using React and a JSON API to fetch the latest data. My approach involves using fetch to load the JSON API and setInterval to refresh the app every 10 seconds. Now, I'm wondering if there's a way to compare the pr ...

Guide on processing output from Rust Actix awc::client into JSON format and accessing JSON components

I've made a request using awc::client that has responded with a Result - body. How can I extract elements from this result? let response = client.post("http://localhost:8002/trace_route") .send_json(&request) .await; ...

Retrieve the nested dictionary

I have extracted a series of elements from an excel datarow: 'Ars','Cr','Assl','Burg','Consp' My goal is to organize them into a nested dictionary as shown below: data_dict.update({'name':'Ars','children':[{ 'name':'Cr','children':[ ...

Creating an object in AngularJS by merging data from three separate API calls

I am looking to develop a Jenkins dashboard using AngularJS. I am considering combining data from three different API calls to create an object that can be used in the HTML file with ng-repeat, but I'm not sure if this is the best approach. The desir ...

A Comprehensive Guide: Obtaining the Final Tab from a JSON using API

What is the method to extract the last tab from a given JSON code? { "claimed_levels": { "level_1", "level_2" } } I want to display the level when someone types "!levels". The desired output format should be: Your current level is "2" ...

Ruby Stateful JSON Parsing Tool

I am currently working with a Ruby server that is continuously reading from a flat file which gets updated every second by another server. This flat file is in JSON format, and I want the server to only read the new data instead of parsing the entire fil ...

What is the process for transferring a document from one database to another in couchDB?

Is it necessary to load a couchDB JSON document to the client first and then post it to another couchdb database in order to copy it from one db to another? Or is there a server-side method that can achieve this? Reference The copy command is non-standar ...

Making a XMLHttpRequest/ajax request to set the Content-Type header

In my attempts, I have tested the following methods individually: Please note: The variable "url" contains an HTTPS URL and "jsonString" contains a valid JSON string. var request = new XMLHttpRequest(); try{ request.open("POST", url); request.set ...

What is the best way to display text from a file on a different html page using jQuery's json2html?

Here is the json data: var data = [ { "name": "wiredep", "version": "4.0.0", "link": "https://github.com/taptapship/wiredep", "lice ...

Converting Java String to JSONObject in Android: Troubleshooting JSONP issue

Here is the code snippet I am working with: String json = request.excutePost("http://192.168.1.42:3000/login_client",urlParameters); JSONObject jsonObj = new JSONObject(json); The error displayed in logCat is as follows: org.json.JSONException: Value ...