Questions tagged [jsonresponse]

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

286 questions
3
votes
1 answer

Grpc-gateway make strange wrapping of com.google.protobuf.wrappers.StringValue result

I have GRPC service with the following function: rpc StreamMessages(StreamMessagesRequest) returns (stream google.protobuf.StringValue) { option (google.api.http) = { post: "/messages:stream"body: "*" }; } With grpc-gateway behind…
3
votes
1 answer

How to access a json response in SwiftUI?

So I am making an HTTP request and I get a response that looks like this: { "code": 200, "status": "success", "patients": { "bogdanp": { "_id": "5e77c7bbc7cbd30024f3eadb", "name": "Bogdan Patient", "phone": "0732958473" …
Susca Bogdan
  • 991
  • 1
  • 9
  • 23
3
votes
3 answers

Android- I am getting Json response as PDF(or)JPG(or)PNG file from Server. How to handle it for view(or) Download by user

I am using http Connection Method: Get Request/response : JSON I have some of the records(refer below Image) with IDs. When user clicks a record. I am calling HttpConnection (JSON Request) to the server with clicked record ID. Json Request URL :…
Venkatesh Selvam
  • 1,382
  • 2
  • 15
  • 28
3
votes
3 answers

How to format JSON output in Symfony

I have a script that expects the following output: [{ "id": "288", "title": "Titanic", "year": "1997", "rating": "7.7", "genre": "drama, romance", "od": "0" }, { "id": "131", "title": "The Bourne Identity", …
PrimuS
  • 2,505
  • 6
  • 33
  • 66
2
votes
2 answers

FastAPI difference between `json.dumps()` and `JSONResponse()`

I am exploring FastAPI, and got it working on my Docker Desktop on Windows. Here's my main.py which is deployed successfully in Docker: #main.py import fastapi import json from fastapi.responses import JSONResponse app =…
blackraven
  • 5,284
  • 7
  • 19
  • 45
2
votes
2 answers

Retrofit Response Array or Object either

In the first case when it returns success true, everything works, the problem when it gets success boolean is false, then the error: How Retrofit Response Array or Object either. Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 26 path $…
andtompoi
  • 59
  • 7
2
votes
1 answer

Error in formatting: AttributeError: 'JsonResponse' object has no attribute '_headers'

I am building an app using Django and JavaScript. In Java I have a function that looks like this: fetch('/posts') .then(response => response.json()) .then(posts => { The first line of the JavaScript code actually calls the "post_list" function in…
Lina
  • 125
  • 1
  • 9
2
votes
4 answers

Axios not showing data response after hitting the API

Calling GET request from the client app axios.get('http://localhost:5000/users/login',user) .then((res) => { console.log(res); }); GET request API User.findOne({email: email}) .then(docs => { bcrypt.compare(password ,…
Karthy Sbk
  • 3,153
  • 2
  • 8
  • 7
2
votes
0 answers

Method threw 'java.lang.StackOverflowError' exception. Cannot evaluate org.json.JSONObject.toString() - on calling json post method

Code to call the api is as mentioned and the json response post method. error while calling json object at the line"JSONObject mJsonObj = new JSONObject(response);". Response available but error occurs as"Method threw 'java.lang.StackOverflowError'…
Android_id
  • 1,521
  • 1
  • 15
  • 33
2
votes
0 answers

try to get response json ,Laravel Pagination has missing meta and links with API resource

Trying $questions=TheQuestion::paginate(5); return $this->successResponce(TheQuestionResource::collection($questions),'',''); { success: true,data: [{},{},{},{},{}],tag: "",message: "" } public function successResponce($data,$tag,$message) { …
satish ray
  • 117
  • 1
  • 10
2
votes
1 answer

Getting Truncated JSON response when calling UPS API using google app script

I am using google app script to Call UPS api and generate shipping label. However the API response is truncated and i am unable to decode base64 encoded image which is part of the JSON response object as it is truncated. I am also not getting any…
2
votes
1 answer

How to create dynamic nested accordion in React Native

All of the examples I've found online only show how to create single level accordion, like this: -parent1 -child1 -parent2 -child2 I need to create dynamic accordion that has multiple nested parents, like this: -parent -subparent1 …
failedCoder
  • 1,346
  • 1
  • 14
  • 38
2
votes
1 answer

Django Rest Framework for nested serializer for POST method json format output (already removed read-only)

I want to create an application regarding student-class attendance in a simplified format like this. I am getting actual output response what I need in GET request like this. [ { "id": 1, "present": "Yes", …
2
votes
3 answers

Retrofit failure(onfailure method is called) : Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 1114 path $.og_user_node

MY Pojo Class package com.webnoo.questin.controllers.networks.pojo; import java.util.List; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class Profile { @SerializedName("uid") …
Naman
  • 39
  • 11
2
votes
1 answer

Laravel API give json response when got error This action is unauthorized

I newbie in Laravel API. There is an update function which only allows users to update their own post. It worked. When users try to update other user's post, it alswo worked, but it shows the error like this image. Actually i want it show in…
akmal
  • 21
  • 4
1
2
3
19 20