Questions tagged [jsonresponse]

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

286 questions
0
votes
1 answer

How to compare the fields present in two json response and validate it?

I need to compare all the countries present in Response1 should be present in Response2 also. So How Can I take all the countries from both the responses and validate? I tried on storing country in ArrayList but not able to validate it. Json…
0
votes
0 answers

Handling JsonResponse in Django template

I'm trying to make a webpage in which you can specify a number of vectors, then insert modulus and angle for each one, and it will calculate the sum. My code can do the calculation, but I can't properly display the result on my…
davide
  • 61
  • 6
0
votes
1 answer

importing chai assertion from chai-openapi-response-validator plugin

I am using Cypress.io framework, and I would like to implement chai plugin called chai-openapi-response-validator which contains a new assertion called…
0
votes
1 answer

Django: AttributeError at /course/u/update-item/ 'WSGIRequest' object has no attribute 'data' using django

I get this error when i try accessing localhost:8000/course/u/update-item/: "AttributeError at /update_item/ 'WSGIRequest' object has no attribute 'data'" NOTE: When i change request.data to request.body i get another error message that says…
0
votes
1 answer

Why i cant add to List in onResponse function

firstly sorry for grammar mistakes, I am trying to create users with the information in my json url. I can get the all the information but when i try to add it to my list in OnResponse, it doesnt add. I log it if i get the data from url and it logs…
0
votes
1 answer

How Can I get Attribute value against each attribute name from a json response in .net after consuming it and deserialized it

public class walletcustinfo { public int ID { get; set; } public string ATTRIBUTECODE { get; set; } public string ATTRIBUTENAME { get; set; } public string ATTRIBUTEVALUE { get; set; } public int…
0
votes
1 answer

Symfony 4 - JsonResponse returns a non-empty object as empty

I'm trying to return the result of an API request (using Postman) in Symfony. Here is my relevant controller code: /** * @Route("/apis/login", name="api_login") */ public function login(Request $request, UserRepository $userRepository):…
Nadim
  • 382
  • 1
  • 7
  • 29
0
votes
1 answer

Issue with django json response

I have issue with json response. messages.values() gives me user_id instead of username. How to get username? Here is my code: class LivechatMessage(models.Model): user=models.ForeignKey(User,on_delete=models.CASCADE, null=True) def…
cryg0
  • 55
  • 1
  • 6
0
votes
1 answer

Send JSON Response Data to a Custom Widget - Ruby Rails 5.2

I'm building a widget that a client can display on their third party website. The widget accepts input from consumers about what kind of house they are looking for. On submit, the widget makes a POST request on a search model within the endpoint API…
tomb
  • 1,374
  • 1
  • 13
  • 23
0
votes
3 answers

Attempting to log JSON response from REST API in JavaScript using Fetch

I have a small script that I have put together. The script does the following: Defines several variables within an array Passes those values to an API API should return an access token const fetch = require('node-fetch'); var orgInfo = { …
Marty Lavender
  • 105
  • 1
  • 12
0
votes
1 answer

Django rest framework: how can I serialize multiple table to get combine JSON output

I am very new to django, any help highly appreciated. thanks in advance! Here is my code 'model.py' class Stocks(models.Model): ticker = models.CharField(max_length=30, primary_key=True, unique=True) company_name = models.CharField(max_length=100,…
0
votes
0 answers

how can i pass result of API in JSON

module Api module V1 class CalculatorsController < ApplicationController def compute @fields = Calculator.find_by(slug: params['id']).fields.result render json: @fields, root: 'result', adapter: :json …
Maksym
  • 1
  • 2
0
votes
1 answer

Laravel Json response exception

How to throw a json response error in laravel outside the controller or any part of the application? something like that throw new ConflictException('any')
0
votes
1 answer

how to convert group by(values) to json - django

i'm trying to convert my grouped by (values in django) data into JsonResponse but it raise this error : AttributeError: 'dict' object has no attribute 'f_type' this is my function of loadding json data def load_cate(request): lists =…
artiest
  • 554
  • 5
  • 20
0
votes
0 answers

How can i make an Arraylist of Objects from response received with volley

I am trying to make an ArrayList of objects .But the logd at the last is always showing an empty ArrayList.How can I do it.With the present code I tried few things but they didn't work.I guess i have to return the ArrayList but I am confused. This…
Anonymous
  • 33
  • 7