Questions tagged [json]

90846 questions
1

votes
1

answer
228

Views

Reading text file with special characters using d3.request

I have a file.txt that I need to get to my script and parse via d3.request. The content of file is encoded with windows-1250 encoding and has extra lines to be deleted, so that only lines starting with 'Date' and '2017' should pass. So far I have been using cli solution to grep text file (removing e...
mtx
1

votes
1

answer
996

Views

Set Select2 selected values with JSON string

I have a select2 that's used to add multiple employees to a work permit. Adding the employees works with no issues but when the permit is viewed I need the added employees to be pre-selected on the select2. I can retrieve the values from the DB via ajax using a JSON string but the select2 only shows...
Drewy
1

votes
1

answer
51

Views

Creating JSON Objects from Relational DB JPA/Hibernate Queries

I have a relational DB accessed with JPA/Hibernate in a Spring web app. I have a lot of Ajax queries where the relational results need to be translated into JSON objects. Is there a simple solution to convert something like this, from a Relational JPA query, to the below? Result [ { id: event-..782,...
gene b.
1

votes
0

answer
137

Views

pass recyclerView image and data to next activity

how to pass data and image from recyclerView item click to the next activity ? i tried and success for only pass data. Failed to pass image using byteArray. Need help for pass data and image for recyclerView item click. RecyclerViewAdapter.java public class RecyclerViewAdapter extends RecyclerView.A...
Saidur Rahman Sumon
1

votes
0

answer
42

Views

Replace attributes values in a XML with php

I have the next XML NOTA And I need to replace all attribute values with uppercase letters by values with the following JSON { 'CODIGOIMPUESTO': '1A', 'TEXTOMONEDA': 'MXP', 'EMISORCORREO': '[email protected]', 'EMISORNOMBRE': 'IVAN SANDER SANDER', 'CODPPROVEEDOR': '6001005599', 'CORREORECEP': 'tes...
Omar Sanchez
1

votes
1

answer
487

Views

create schema for imported csv in mongodb

i have a csv that looks like this: Number,Date,ClientName,ClientSurname,ClientAge,Option1,Option2 1,01/01/2015,John,Foo,24,30, using mongoimport i get { '_id':ObjectID(''), 'Number':1, 'date':'01/01/2015', 'ClientName':'John', 'ClientSurname':'Foo', 'ClientAge':24, 'Option1':30, 'Option2': '', } w...
doe
1

votes
1

answer
1.1k

Views

webpack build error TypeError: Converting circular structure to JSON

I'm facing an error in building and running dev server with Webpack. I use Vue.js and used vue-cli for generating a project. For testing, I'm using Jest and npm test runs with no problems. If I run npm run build I get this error output: ERROR in TypeError: Converting circular structure to JSON -...
Mikeee
1

votes
1

answer
59

Views

Handling complex html elements with JavaScript/jQuery

I'm working with the FirstSpirit CMS. This CMS generates HTML-Pages in a similar way as php does. The code below shows a snippet from a module: var elements = { start: '$CMS_VALUE(getStartDate)$', ende: '$CMS_VALUE(getEndDate)$', alwaysVisible: $CMS_VALUE(st_alwaysVisible)$, html: [ $CMS_FOR(element...
Brotzka
1

votes
1

answer
35

Views

Iterate through properties in a loop

I'm trying to loop through a row of data for a set amount of times to access a different property every time. The data looks like this: [JsonProperty('Afbeelding')] public string Afbeelding { get; set; } [JsonProperty('Afbeelding_2')] public string Afbeelding2 { get; set; } [JsonProperty('Afbeelding...
Michelindoll
1

votes
1

answer
86

Views

Feedback json format wrong

This is my feedback json string: {'name':'abc', 'cardNumber':'1234567890', 'data': [{A data},{B data}...]} I use this function to send data, then get json and encode: func uploadData(word:String){ var request = URLRequest(url: url!, cachePolicy: .reloadIgnoringLocalAndRemoteCacheData, timeoutInterv...
Howard
1

votes
0

answer
482

Views

MVC Ajax, Post to Controller base64 string

In my project I send post json data object. One item of this object is base64 string. When base63 string is too long, my request doesnt reach to controller. In my opinion , due to length of parameter,it doesnt work. I couldnt find any solition. [HttpPost] [ValidateInput(false)] public ActionRe...
Çağrı Taçyıldız
1

votes
1

answer
234

Views

How to get root value of Json get from dialogflow?

I got the json response from dialogflow. Now I want to get the 'q1' value. So I've tried this: var stringjson = ApiAiJson.Serialize(queryResponse); var deserializejson =ApiAiJson.Deserialize(stringjson); if (deserializejson.Result.Action == 'web.search') { JObject jsonob = JObject.Parse(stringjson);...
1

votes
2

answer
73

Views

Google chart not draw

I have a one question. google chart not draw. Here is my code google.load('visualization', '1', {packages:['corechart']}); google.setOnLoadCallback(drawChart); function drawChart() { var jsonData = $.ajax({ url: '/temhum', dataType:'json', }).done(function (jsonData) { var data = new google.visuali...
전준휘
1

votes
0

answer
238

Views

compare date strings to json date strings

A User selects a pair of dates from two jquery-ui datepickers, when the user selects the second date both values are compared to strings stored in an external JSON file. If the dates are within the dates below external data is returned to the html page. The dates look like this: 'startDate':'01/01/2...
ernesto fernandez
1

votes
1

answer
224

Views

JMeter Beanshell adds backslash to cookies values

The application for which I am preparing performance script is implemented on Sails and uses cookies for validating authentication for API calls. Using the HTTP Cookie Manager from JMeter did not help as it did not record all the cookie values. I was able to add them manually using beanshell preproc...
user2747610
1

votes
0

answer
56

Views

How to get the JSON Body for CreateAsync Force.com Toolkit for .NET

Hi I am trying to create an Orderitem for an Order just created but I am getting this following error JSON Deserialization failed on token 'null' and has left off in the middle of parsing a row. Will go to end of row to begin parsing the next row How do I get the JSON RAW Body that is being posted s...
CidaoPapito
1

votes
1

answer
45

Views

JSON post returning null when passed from view to controller

vm.Name returns null when it's passed from view to controller but when I call for the data in view, it shows up fine. $scope.afterSelectedIngredient = function (selected) { if (selected) { $scope.selectedIngredient = selected.originalObject; $scope.newIngs = []; var ing = {}; ing.Name = $scope.selec...
klent
1

votes
0

answer
45

Views

Continuing PHP code while function runs in background

EDIT: I should note this is for an HTML page. Hi experts, I'm fairly new to PHP and i have a question which might be relatively easy to answer. I have a while loop which contains the code to make an API call and load the received json into some variables. This loop has a sleep(5) in it so it checks...
J. Doe
1

votes
0

answer
48

Views

Is there a way to “deserialze” a field paths in jackson

I'm working on a generic dao bean similar to CrudRepository. The principal difference is that this tool will streamline fetching, filtering and sorting. I have it working almost perfectly. One problem which I am still facing is that I need the jpa path. I would like to be able to pass in the path as...
chrisgotter
1

votes
0

answer
431

Views

PSR-4 Autoloading in Laravel

Working on an application that will be used to extend the Chatter package Issue is, I want to make modifications to the package but don't want to do is directly to the package. Changes won't persist after a composer update. Now from my understanding extending the package would require me to exclude...
sogeniusio
1

votes
1

answer
398

Views

Fetch and cache a JSON file

What is the best way to fetch a JSON file and cache this on the server? I want to get a JSON file from a remote source and cache it (for example for 24 hours) so it costs less internet capacity :) class Json { public $url; public $hash; public function LoadJson($url) { // Exist function if (file_exi...
1

votes
0

answer
330

Views

Photo gallery with fetch API in React.js needs iteration

In my project made in React.js I'm having a problem with ITERATIONS. In this React Component (ViewSectionList) I am fetching 6 images. And each of them IS from a different API. My code allows to render these pictures, but it is not efficient, mainly because I don't know how to: get all the images f...
daxtersky
1

votes
1

answer
282

Views

Is it possible to embed YAML into a JSON payload?

Is it possible to embed YAML into a JSON payload? And if so, How? I'm trying to come up with a JSON request which has a embedded YAML embedded, a very large YAML file at that: { 'deployment':{ 'family':'mui', 'assemblyfile': 'large YAML file here' } }
Swaroop
1

votes
0

answer
45

Views

How to get table data from HTTPSConnection using python

I would like you to help me in getting the data from Httpsconnection since the webpage is ASP.Net and the data can not be retrieved from beautiful soup directory, I implement the code below: import http.client import requests from urllib.request import urlopen from bs4 import BeautifulSoup conn = h...
Hannah
1

votes
0

answer
118

Views

Using Paperclip to upload images within a json attribute in a model in Rails 5

I'm currently using Paperclip to manage avatar uploading for users in my Rails app with Amazon S3. I also have a json attribute in other model (a column) which stores dynamic data. Sometimes this attribute will hold an image and sometimes not. What I want to achieve is to be able to upload files ins...
aleherzko
1

votes
1

answer
239

Views

json.dumps unorderable types when using None as a key

When calling json.dumps on an object that contains a dictionary with a None and str type, how do I have it sort the results without throwing an exception? I'm trying it with sort_keys=True but that threw a TypeError. I don't care how None and bar are sorted relative to each other as long as it's con...
TinyTheBrontosaurus
1

votes
0

answer
243

Views

webrequest handing error 502 and 500 in c#

I am building a project using c# that should get some JSON information from a website, then do certain process on it. Generally it works 80% of the times, but the remaining 20% I get Error 500 or Error 502 or even empty JSON file which I don't know how to handle. I handled the Empty JSON with a time...
DrGM
1

votes
3

answer
40

Views

Split the string array

I know this question was absolutely answered but i did not find solution. I get response from web-service a Json string response that is ['11,22222','33,44444']. I try this but did not work because string include these characters [ ] and first comma is in the here 11,22 StringBuilder result = new St...
1

votes
0

answer
54

Views

put and get json in ledger using go

I am quite new to Go programming. I am trying to insert a json into blockchain ledger and read it back using golang. My json looks like below: var jsonBytes = []byte(`[{'FLD1':10,'Fld2':'ABC'}, {'FLD1':100,'Fld2':'0.26'}]`) Ultimately, this json will be used as a look up table in my blockchain code....
user1456110
1

votes
1

answer
158

Views

JSON schema that validates if patternProperties matches one of the value

Given this schema: { 'type': 'object', 'patternProperties': { '^(.*)$': { 'type': 'object', 'patternProperties': { '^.*$': { 'oneOf': [ { 'type': 'string', 'enum': ['Token1', 'Token2', 'Token3'] } ] } } } } } I am able to validate this sort of data: { 'myobject': { 'prop1': 'Token1', 'prop2': 'Token...
Annie
1

votes
2

answer
75

Views

Send JSON data via POST PHP instead of Ajax version

I have to create a JSON object that is the equivalent of a JSON object created with this Ajax code snippet: $.ajax({ type : 'POST', url : '?', dataType: 'json', data : 'username=' + encodeURIComponent($('input[name='username']').val()) + '&password=' + encodeURIComponent($('input[name='pas...
UrbiJr
1

votes
0

answer
18

Views

API call works on my browser but not in my javascript code?

I'm trying to call the Binance API to get the LTC price in BTC and I tested the link on my browser 'https://api.binance.com/api/v1/ticker/price?symbol=LTCBTC' which returns the information I need but when I go to implement it in my code nothing happens and I don't get any errors in console either. A...
crypto virtex
-1

votes
0

answer
13

Views

How do I write an object in JavaScript into an external .JSON file?

So I have created a simple HTML/CSS file to make invoices and to maintain the database I'm saving the the data into localstorage and from there into an object(I know this is not the most efficient way but I was experimenting and then never got to changing it back.), which I plan to save into an exte...
Aditya Parikh
1

votes
1

answer
285

Views

JAVA - custom error response for invalid data

I wrote a post controller to handle a date from JSON request. Right now, for invalid dates, it returns a general 500 error without description. (i.e 'statusDate': '2017-13-27') How can I return a custom error message instead of a general one? (i.e 'Invalid date in 'statusDate' ') This is the code:...
Dvir
1

votes
1

answer
318

Views

Decoding JSON with varying key-value pair using Decodable

I am attempting to parse JSON using Decodable that has the following structure and I am being thrown the error: does not confirm to protocol 'Decodable' The JSON structure looks as such: { base = SGD; date = '2017-12-29'; rates = { AUD = '0.95769'; BGN = '1.2205'; THB = '24.414'; TRY = '2.8372'...
Koh
1

votes
1

answer
94

Views

Docker - Import Json Docment Inside The Solr Core

I want to ask if there is a way to import Json document into the core from the docker file while creating the core, or if I can mount a pre-created core directory with the Json file already imported inside it. An another method than import the document from Solr server page in Documents core tab and...
Ebraheem Alrabee'
1

votes
0

answer
58

Views

Android JSON request until condition

I'm using YouTube API to get all videos in specific channel using HTTP get request to this link (taken from API): https://www.googleapis.com/youtube/v3/search?key=API_KEY&channelId=UChTPjh6w51yg4iwCLgXHQTg&part=snippet,id&order=date&maxResults=50 the API get 50 results at most per request and to get...
alhassan ali
1

votes
1

answer
769

Views

How to push one array to another during subscribe Angular 2

How to pass value of array to another empty array during subscribe in Angular 2. I want to create infinite scroller in Angular 2. I have an array of 10 values. In infinite scroller, I want to repeat those 10 values again and again. Below is the code in the component: array =[]; eNews = []; getNewsLi...
asp
1

votes
0

answer
270

Views

Parsing json with AsyncTaskLoader

I'm trying to use AsyncTaskLoader to retrieve data then parse the resulting json file, however, I can't figure out why I keep getting a return null; instead of returning return gameList; DailyScheduleFragment.java Method calling the Loader: public void loadGameScheduleList() { getLoaderManager().in...
Ziggy
1

votes
2

answer
96

Views

Get value of object field using variables to build the field name

I am using a free currency converter API as shown in the code: // Free Currency Converter url = 'https://free.currencyconverterapi.com/api/v5/convert?q=EUR_USD&compact=ultra'; response = UrlFetchApp.fetch(url); rateEURUSD_FCC_JSON = JSON.parse(response.getContentText()); rateEURUSD_FCC = rateEURPLN_...
Rafal2017

View additional questions