Provides simple classes for JSON responses that adhere to a standardized structure.
Questions tagged [jsonresponse]
286 questions
0
votes
2 answers
Rocket - Status with json body
I try to return json body with errors in Rust's Rocket.
pub fn error_status(error: Error) -> Status {
match error {
Error::NotFound => Status::NotFound,
_ => Status::InternalServerError
}
}
#[get("/user/")]
pub fn…

nicram
- 353
- 3
- 7
- 24
0
votes
2 answers
I have a problem to use Volley. want to use POST method with some parameters and get Array type response but my response is not array type
I have a problem using Volley. want to use POST method with some parameters and get Array type response but my response is not an array type. Here, I share my request code and response.
RequestQueue queue = Volley.newRequestQueue(this);
…

M Ishaq Butt
- 1
- 3
0
votes
2 answers
how to display either video or image from response?
I am getting a response from JSON API where a "Video" tag contains a video or image name with its extension as shown below. I want to show video if that tag contains video (I am loading video in Web view) then hide Image view, or show image if it…

Pratik Chauhan
- 67
- 11
0
votes
1 answer
how to replace property values in a dynamic JSON?
I'm reading my json file from and trying to replace the property values. JSON file is below.
{
"fields": {
"summary": "summaryValue",
"project": {
"key": "projectValue"
},
"priority": {
"name": "priorityValue"
},
…

Allison Paiva
- 37
- 1
- 5
0
votes
0 answers
Fetch specific column in Django using JsonResponse
I have a problem on how can I filter specific column using Jsonresponse in html. I just want to filter specific column Paid_by. It is possible to filter in Jsonresponse just like this response.data.paid_by. Other option how to filter specific…

BootCamp
- 444
- 4
- 18
0
votes
1 answer
How to return multiple dataframes as JsonResponse in Django?
I have 2 dataframes. I have to send these two dataframes in json format whenever the django API is called.
c = a.to_json(orient='records')
d = b.to_json(orient='records')
return JsonResponse(json.loads(c,d),safe = False)
a and b are dataframes
I'm…

Theguy
- 33
- 9
0
votes
1 answer
Serializer do not send the related field
I am using Django rest framework to create an API based on an already existed database. I am trying to send related field values for requests for the appointment model. All field data are sent, except the related field value. even no empty fields…

Amir Sabzehparvar
- 78
- 9
0
votes
0 answers
Adding comments with Ajax and Django
I am trying to ajaxify my comment form so that it can be submitted without refreshing the page. I have a Comment model which has a ForeignKey to the Post model:
class Comment(models.Model):
user = models.ForeignKey(Profile,…

sgt_pepper85
- 421
- 4
- 14
0
votes
0 answers
Unable to display JsonResponse in Django web project
I am working on a django project. I want to display the result of a query with JsonResponse, but I can only get the raw data, rather than the colourful Json response.
Here is my code
views.py
from django.shortcuts import render
from django.db import…

Yihe Wang
- 39
- 4
0
votes
0 answers
Hello Bar webhook Integration with coldfusion
I am using hellobar popup on my website. Hello bar popup has a contact form with email field. A user comes to site and provide its email to subscribe. Then hello bar sends that information of user to the owner of using email tools and webhook. I…

user9094763
- 31
- 3
0
votes
1 answer
How to response a Django request from nested function?
Let say I want to test several data before proceeding and if it fails return an error response directly to the person who made the request.
I have this:
def gerUserInfo(request):
if request.user.is_authenticated:
data =…

Zorro
- 1,085
- 12
- 19
0
votes
1 answer
how to extract json body as string using java
I have a JSON response and i am extracting the body using getbody() command and storing the responses in list. because i am passing multiple JSON at a time so each response i am storing in list as string value. How can i extract that JSON using…

sarath
- 107
- 7
0
votes
0 answers
how my browser know which kind of json object should it create for a specific site?
i wonder how my browser know which field it should create for a json and add it to the request header?
i mean when you go to different sites and for example login or send buy request etc. how my brower know which field it should create for json?
i…

MBarzegar93
- 3
- 2
0
votes
1 answer
Django: TypeError: int() argument must be a string, a bytes-like object or a number, not 'ObjectId'
Im getting this type error when trying to return a JsonResponse. In the code python_serializer is an object that has a instance variable named data containing the results of the JsonParser().parse(request) which is of type dictionary(in python).…

Alex
- 151
- 8
0
votes
0 answers
Retrieve a value from JSON response
The JSON response looks something like this
[
{
"name": 0,
"age": 0,
}
]
I created a JSON object and tried to create a JSON array
JSONObject myjson = new JSONObject(res.asString());
JSONArray resArray =…

Abhishek
- 1