Questions tagged as 'json'

0
answers

Error: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $

I'm trying to consume data from an API using retrofit, however whenever I try to connect it returns that error. I'm using a class that is an Array of these objects (SisalfaCatalog) and throwing the return inside it, but it does not work. Here is...
asked by 06.08.2018 / 01:16
0
answers

Send a jquery variable via ajax to PHP

I'm trying to send data from a table via Ajax to PHP. I'm doing this by transforming the table into JSON and thus sending via Ajax to PHP. The scritp looks like this: <script type="text/javascript"> $('#converter-tabela').click( func...
asked by 04.07.2018 / 17:29
0
answers

Ajax / Json POST Treatment

I'm having trouble sending Json to my Controller in PHP:    See,insendingmyLogintheparametersthatarebeingsentintherequestareexposed,thusbeingavulnerability.Myquestioniswhetheryouwouldhaveamethodofsendingwithoutrequiringanexternalcryptography...
asked by 31.07.2018 / 13:41
1
answer

How do I calculate the "positives" and "negatives" functions from a json file to HTML in percentage?

Save, I have a JSON file with "positives" and "negatives" variables, I'd like to turn those values into percent, "positives" being "Like" and "negatives" being "Do not like." After that how could I organize the profiles based on this data? JS...
asked by 21.06.2018 / 01:17
1
answer

Javascript: Function is not returning the correct value [duplicate]

What could be wrong with this function? Where alert is, the correct result is coming, but it is returning 0. function AprovaCotacao(numForn) { var forn_aprovado = $("#cot_fornecedor" + numForn).val(); var id = $("#cot_id").val...
asked by 22.06.2018 / 03:06
2
answers

Array PHP / json

I need to generate a JSON in the following format: { 'plan_id' => 2, 'customer_id' => 16, 'payment_method_code' => 'credit_card', 'product_items' => [ [ 'pr...
asked by 06.06.2018 / 00:50
0
answers

How to compile the JSON-C library on Windows?

Personally I downloaded the source code of the json-c lib, but I do not know how to compile using codeblocks     
asked by 06.06.2018 / 08:11
0
answers

Pass angular array on json to mvc controller

I have this function that generates an array, I need to pass to the mvc controller through JSON, but it is not passing, it follows what I'm doing: var app = angular.module('myApp', []); app.controller('myCtrl', function ($scope) {...
asked by 06.06.2018 / 16:47
0
answers

Decode JSON files in PHP without json_decode

I'm currently returning JSON query data via ElasticSearch, but returns have a lot of information and using json_decode to manipulate this data becomes very costly for the server. For example, the server memory usage is at 5MB when returning t...
asked by 06.06.2018 / 16:00
1
answer

Return data in JSON into an array, replacing the database ID with their names. How can I do this?

I made this code, but it only returns me the ids, and I would like instead of the ids it does a search for the inner join in the database and returns in place of the ids the names. Code php: <?php header('Content-Type: application/json')...
asked by 26.05.2018 / 13:37