Questions tagged [jsonencode]
10 questions
2
votes
1 answer
Controlling the number of significant digits used by jsonencode
I'd like to use jsonencode in Matlab R2022a to encode a structure containing double precision values, like e.g.:
>> s = struct('a', sqrt(2))
s =
struct with fields:
a: 1.4142
>> jsonencode(s)
ans =
'{"a":1.4142135623730951}'
But I don't…

Ratbert
- 5,463
- 2
- 18
- 37
1
vote
2 answers
How to make json keys as a special order in Swift JSONEncoder?
I need make a request to a server of an open API. The rule of the open API asked json parameter must make keys as a special order(not the A-Z order nor Z-A order).
struct Req : Encodable {
let SourceText: String
let Target: String
let…

boybeak
- 417
- 5
- 19
0
votes
0 answers
JSON Data is not generated in excel sheet
I created an bearer token generating api that creates a bearer token when a user loged in.
and I also have an protected.php file that authenticate the token and create the excel sheet that contain the json data using phpspreadsheet.
but in my case…
0
votes
1 answer
getting error status code 500 from the jsonencode in flutter
onPressed: () async {
final url = Uri.parse('https://anash-visual-qa.hf.space/run/predict');
final response = await http.post(
url,
headers: {'Content-Type': 'application/json'},
body:…

dhyanmohan
- 3
- 2
0
votes
0 answers
Remove " " from keys when PHP associative array in parsed through json_encode
I am trying to supply some data to a Javascript Function but right now i am unable to convert it to desired format.
The Correct Format that is Working is below.
const eventsArr = [
{
day: 1,
month: 1,
year: 2023,
…

Nomi
- 27
- 1
- 6
0
votes
0 answers
Cannot remove strings from list in flutter
I have a page to select images from the gallery and add those urls in a list that will be passed to another page after popping. Everything works fine the first time the user accesses the page, however, when coming back to the Image View with an…
0
votes
0 answers
JsonUnsupportedObjectError (Converting object to an encodable object failed Error in flutter
I am facing problem while trying to encode Json data to a List of String
CartRepo.dart
import 'dart:convert';
import 'package:ecommerceapp/models/cart_model.dart';
import…

Sahil Tiwade
- 11
- 2
0
votes
0 answers
Getting "Errno Extra data" while self.wfile.write in Python HTTP server
I am new to python. In HTTP server, I am getting "Errno Extra data" while writing data. The code is below
class handler(BaseHTTPRequestHandler):
def do_GET(self):
global data, payload0
if…

Unfold
- 1
0
votes
1 answer
Use of JSON_EXTRACT() in a loop – Return Data from a JSON Document in MySQL
I try to use the JSON_EXTRACT() function, on my request I have to loop on the "item" object (attention not "items" which is present several times in the JSON file) :
{
"quantity": 1,
"amount": 10,
"token":…

athanar
- 1
- 2
0
votes
0 answers
Json_encode failing on special chars and array_map throws 500 error
I've got a simple bit of php that is reading data from a SQL db and json encoding the rows and echoing it out.
It works a treat until any of the columns contain any special chars; then the output is empty.
I understand that JSON_ENCODE needs the…

John
- 755
- 1
- 18
- 46