Questions tagged as 'json'

3
answers

Add "name" to a JSON object

My JSON currently returns this low code: {"2":"aluno","8":"barbara_cristina","13":"carolina_deus"} How do I add a "header" in numbers 2, 8 and 13? I wanted it to look like this: {"nome":"aluno","nome":"barbara_cristina","nome":"carolina_d...
asked by 14.04.2016 / 18:40
3
answers

AJAX with HTML data return

I have an AJAX function: function userCheck() { var username = $("#username").html(); var userid = $("#balmung-id").val(); $.ajax({ url: "systems/usercheck.php", type: 'POST', data: { username:...
asked by 22.12.2016 / 12:27
1
answer

REST - Http x Json

I did some research and I have some questions about REST: Http is Rest? Is JSON and XML just the return format of a Rest operation? REST x Web Services: are the same things? SOAP would be the opposite of HTTP? Thank you for helping...
asked by 28.03.2016 / 14:34
3
answers

Read array JSON on Android

I'm having trouble reading a JSON in the format: [{"RESULTADO":"SUCESSO"}] WebClient.java: //PARA LER UM JSON, USAMOS A Scanner Scanner scanner = new Scanner (connection.getInputStream()); String resposta = scanner.next();...
asked by 04.12.2018 / 02:30
2
answers

How to remove a Key from a JSON

Suppose the following JSON: {"id": 1, "preco": 100, "detalhe": "nenhum"} If I build an array with 100 of these objects and want to remove the "detail" key from all, for example, is it possible (without being in the hand)?     
asked by 14.11.2018 / 17:25
2
answers

Request AJAX post with angularjs

Hello, I wanted to know how I make a POST request for a url with angularJS and also wanted to know how I transform a normal javascript object into a json, to send in that request.     
asked by 14.02.2015 / 07:04
4
answers

How to capture elements in a json structure using javascript

I need to get some elements inside a Javascript JSON framework. I can get unit elements like this: alert(response.paymentMethods.CREDIT_CARD.options.MASTERCARD.images.SMALL.path); alert(response.paymentMethods.CREDIT_CARD.options.VISA.images.S...
asked by 04.01.2015 / 18:54
2
answers

Represent relationships in json

What is the correct way or best practice for representing the relationships of a resource in json? As an example, I have the tables contrato , representante and empresa and the relationships contract N: 1 representative and...
asked by 14.03.2017 / 13:21
2
answers

JSONObject with multiple values without using Array

Objective Create a JSON with the following structure: { "auth": { "user": "rbz", "token": "abc123" } } Scenario Creating the root structure: JSONObject JOraiz = new JSONObject(); Creating the values us...
asked by 29.11.2018 / 11:11
2
answers

Doubts regarding the use of json_encode and json_decode

When and how should we use json_encode and json_decode ? What are they for?     
asked by 22.06.2017 / 17:28