Questions tagged [jsonresponse]

Provides simple classes for JSON responses that adhere to a standardized structure.

286 questions
1
vote
0 answers

Some JSON Files Unable to be Read, Invisible Characters?

A project I am developing reads through JSON files for data on different animal Species. There are roughly 150+ of them, and most are read fine except for 19 of them. These return as only, [key: value]. I cannot find any formatting error in them and…
dyllandry
  • 113
  • 1
  • 11
1
vote
1 answer

How to store the data like category in ios

I'm working one shopping app and I have response data's like All Categories for Example Main category has men, women,kids etc. Each one has sub-Category like T-shirts, shirts, footwear etc and that also have some sub category(ex.footwear) casual…
iOSDevp
  • 203
  • 1
  • 12
1
vote
0 answers

How do I place the following queries to the Google Mail API

I executed few requests through POSTMAN but I am always getting this error: { "error": { "code": 404, "message": "Not Found", "errors": [ { "domain": "global", "message": "Not Found", "reason":…
Kalpa-W
  • 348
  • 3
  • 22
1
vote
1 answer

How to secure Spring MVC REST service json response

I am using Spring MVC and REST web services. When I make a REST service call my Spring MVC controller will return me a JSON response. Everything is fine till now. I have a requirement where I need to encrypt the spring controller response which is a…
naveen kumar
  • 23
  • 1
  • 4
1
vote
0 answers

JsonResponse with model instance including M2M

It seems that you cannot replace from django.core import serializers from django.http import HttpResponse, JsonResponse qs = MyModel.objects.filter(pk=1) data = serializers.serialize('json', qs, fields=('id', 'name', 'my_m2m_field')) # I want data…
yofee
  • 1,287
  • 12
  • 25
0
votes
0 answers

Django jsonresponse and ajax

I am trying to send JSON response from django using following code: def get_symptoms(request): reply = simplejson.dumps({"name":"Amit","address":"B-123 Bangalow","age":23,"phone" :"011-4565763"}) return HttpResponse(reply,…
0
votes
1 answer

Python - Insert new key value pair to each object in a JSON response

I have this code for transforming JSON response and I'd like to insert the tags, channels, and members into each object. import pandas as pd import requests members = [12321,21223,22131,23134] tags = [6345,3456] channels =…
JamesBowery
  • 71
  • 10
0
votes
2 answers

Sending csv file from Flask API along with json response

Hi So I have to send json response from my Flask API including the file, so earlier I was using this for sending the json response @app.route('/idea123',methods=['POST','GET']) def func123(): try: DOWNLOAD_DIRECTORY=r'../../..' …
0
votes
0 answers

Invalid JSON response from server when enabling Spring Security Config extended by VaadinWebSecurity

Hеllo, all, I have a Java project that uses Vaadin 24.0.3, Spring boot 3.0.5, Java 17 and you can see the full project on this link. This is the error that I am getting when trying to implement SecurityConfig class: Invalid JSON response from…
Jmork
  • 23
  • 7
0
votes
1 answer

Is there a way to return 3 files together with some data calculations from one Django request?

I have a Django request doing some ML calculations. The request takes 3 files as input and generates several files as an output together with some temperature data calculations that I need, therefore I need to return content type =…
0
votes
1 answer

PHP AJAX response.status return undefined

I have two problems really here, the first one being that when I try to evaluate response.status I get undefined and the second one being that my "$_SESSION['promo-code'] = $arr" is also not being created. When entering a promo code, I get the…
IssaMax
  • 11
  • 4
0
votes
2 answers

Django object of type fraction is not json serializable

from django.http import JsonResponse, HttpResponse from django.shortcuts import render from math import sqrt from fractions import Fraction def index(request): return render(request, 'home/index.html', {}) def multiplication(request): …
0
votes
1 answer

Laravel response()->json returns html page on server in case of validation errors

I have a Laravel 8 API application. Below is my example test method in the controller which return status 422 with invalid data JSON response. public function testInvalid() { $arrResponse = [ 'success' => false, …
Amit Shah
  • 7,771
  • 5
  • 39
  • 55
0
votes
1 answer

python fastapi giving incorrect responses

I have a fastapi app connected to my firebase firestore. I am writing a simple endpoint to check if the current user has an admin role or not? I have written the following code for the endpoint @router.get("/isAdmin") def is_admin(userId: str): #…
Prakhar Rathi
  • 905
  • 1
  • 11
  • 25
0
votes
1 answer

Using Pagination with JsonResponse

I'm currently working on CS50W Network project which is basically a social media clone. I want to get different objects via a fetch API request, which is working fine. But after I implemented Pagination I get a 404 not found. When The DOM of the…