---
title: "Send JSON Data for Debugging"  
description: "Send JSON Data for Debugging"  
author: "Hank Greenberg"  
published: 2013-06-20  
updated: 2013-06-20  
canonical: https://www.mindstick.com/forum/1248/send-json-data-for-debugging  
category: "json"  
tags: ["json"]  
reading_time: 2 minutes  

---

# Send JSON Data for Debugging

Hi [Developers](https://www.mindstick.com/articles/12875/blunders-you-must-avoid-while-hiring-java-developers-to-get-the-best-fulfilling-your-needs),\
I would like to debug [client side](https://www.mindstick.com/forum/160418/what-are-the-best-practices-for-securely-storing-bearer-tokens-on-the-client-side) [applications](https://www.mindstick.com/articles/12847/how-to-choose-the-right-ethernet-cable-for-industrial-applications) by manually creating a [JSON data](https://www.mindstick.com/forum/782/how-to-send-request-amp-amp-response-from-json-data-using-asp-dot-net) stream. I was hoping that Google Chrome's debug console would be able to do this.\
For example, consider the following case. I want to test how a list [population](https://answers.mindstick.com/qa/33541/list-top-10-tiger-reserves-in-india-with-maximum-tiger-population) code segment would work. Let's say I have item objects of the format: {"name" : "test", "price" : "10"}. Instead of actually coding this up on the server, I would like to generate this data locally and send it for testing purposes.\
The [Javascript](https://www.mindstick.com/articles/874/how-to-create-watermark-text-for-textbox-by-using-javascript) would look something like this:\
**//[JQuery AJAX](https://www.mindstick.com/forum/157890/how-does-the-jquery-ajax-method-work-what-are-some-common-options-and-parameters-used-in-it) call to request data****$.getJSON('some_url', [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server)(data) {****\** **//Go through each received JSON element (assuming array input) and** **//log its key value pair to the debug console (using Google Chrome as example)** **$.each(data, function(key, val) {** **console.log("Key is: " + key + " value is: " + value);** **}****\****});//End getJSON****\**I would want to make a list of data (perhaps in a [text file](https://www.mindstick.com/forum/12828/converting-a-text-file-to-an-array-in-java)?) like so:\
**{"name" : "paper", "price" : "5"}****{"name" : "bear repellent", "price" : "10"}****\**I would then like to pass this data into the function to see if it works and see the output (accomplished here by the console.log() call). I understand that this is somewhat like [unit testing](https://www.mindstick.com/articles/333232/unit-testing-in-dot-net-best-practices-and-tools), and my research indicates that this might be the job for a REST client. However, I am unsure how to accomplish this. Input is appreciated.\

## Replies

### Reply by AVADHESH PATEL

Hi,\
simply create a js file in the following format\
var tempData = [ {name : "paper", price : 5}, {name : "bear repellent", price : 10},];\
Add this file to your page using <script> tag\
Then use the tempData object as data in your function call


---

Original Source: https://www.mindstick.com/forum/1248/send-json-data-for-debugging

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
