Questions tagged [jsonresponse]

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

286 questions
1
vote
1 answer

How to get generic? class from json response? If one object can contain many different classes

I want to extract json object with restassured, and response is generic like: @Data public class ExtractBase { private Class result; // here I can expect different classes private String targetUrl; private Boolean success; …
Vorgan
  • 11
  • 1
1
vote
1 answer

How to send two response for a single post request in Django Rest Framework?

I am processing a video in backend but it's taking some time so I am looking for a way by which I can send the process time first and after it's completion I can send the video url. I tried using HttpResponse.write() but it didn't send the response.…
1
vote
0 answers

How to recover a failed jsonrequest from a requestqueue

I'm working on a volley POST call from an Android java app that will work onboard a ship where communications are not very good, so there are many fails. The data are sent every 5 minutes to a requestqueue that can accumulate many requests, some of…
Fernando
  • 11
  • 1
1
vote
0 answers

I'm doing a get request with fetch in a django app, it works in development but not in production and cannot get the problem

The application is deployed on heroku. When I run the program on my machine it works fine, but in production I get different errors. In Google Chrome in the console I get the following error: Uncaught (in promise) SyntaxError: Unexpected token < in…
1
vote
1 answer

How to get specific field from response - to set in getOptionLabel of autocomplete

Response 'ItemData' will have n number of fields, i want to retrieve specific field, eg'itemNo' and set it to 'ItemData'. Instead of the whole response. So that i can use that in getOptionLabel of autocomplete. As I would like to set 'option =>…
Sarahrb
  • 407
  • 11
  • 24
1
vote
1 answer

How to returning only as string column in json response object from eloquent relationship using eager loading

I'm trying to figure out how to eager load data as a string instead of array object from a related table. I have 3 models and here are the relations Product.php class Product extends Model { public function ProductTag() { …
Marty
  • 302
  • 4
  • 18
1
vote
0 answers

Navigating to different page instead of Ajax call

I am trying to save a form via ajax as I don't want to reload the page. It is working not completely but it is updating the data except the image or video or any upload file we give. but after updating it is coming back to the ajax page but the url…
Vipul Mittal
  • 41
  • 1
  • 5
1
vote
1 answer

get data value from jsonResponse Laravel 8

I have two controller the first one has a register method: public function register(Request $request) { $generalTrait = new GeneralTrait; $user = new User; $user->email = $request->email; $user->password =…
Rama Re
  • 11
  • 1
1
vote
1 answer

How to map the complex json response of the following type to java model class

JSON Response: { "data": { "account_summary": [ { "aggregation":{ "activeAccounts: { "value": "0" }, "deletedAccounts: { "value": "1" }, …
1
vote
1 answer

Why i am getting null if response in not success in response android retrofit API?

My problem is that when response is successful, i am getting response. But if response is not success, I am not getting any response in body, it's null. In case of any error like 404, 500 response is null. I am a beginner. void sendMessage(){ …
Rakesh Saini
  • 660
  • 2
  • 7
  • 20
1
vote
2 answers

Handling a success and failure response Django

user is sending an api request to crate order along with information in request body and after saving the data i am returning the order_id and access_token to the user.I have used few authentications also with using model.full_clean().Now i am…
1
vote
1 answer

In HERE API traffic flow data JSON response, What is the meaning of "SSS" and "SS' ? Where can I get complete list of meanings for JSON response?

Json response for traffic flow data I tried to find meanings of acronyms of JSON response provided by HERE-API for traffic flow data. But couldn't find the meanings of "SSS" and "ss" and a complete list of meanings for JSON response. Please let me…
1
vote
2 answers

How to I return JsonResponse from Paginator's page? Object of type Page is not JSON serializable

(this is my first stackoverflow question ever) I want to return JsonResponse from the dictionary "context" (seems to be a paginator Page) as coded below: myposts = userposts.all().values() myfollowers = userfollowers.ffollowers.all() myfollowings =…
Sha K
  • 13
  • 2
1
vote
1 answer

How to pass variable with the json() response received from an api using JsonResponse in Django. TypeError: 'int' object is not callable

This is my function in views.py which calls the api and send the response on html page. r = requests.post(RUN_URL, data=data) return JsonResponse(r.json(), safe=False) I have a global variable 'counter' which I want to return along with that…
1
vote
1 answer

Flutter Parse Json Returing Null

Having an issue with my flutter project parsing a json response and returning null. Trying to receive the latitude and longitude values of an address I input. When I print out the jsonresponse variable I get the correct data, but when I try to parse…
Smooth
  • 31
  • 1