JSON

488

Solutions

535

Contributors

JavaScript Object Notation, or JSON, is human-readable text used when transmitting data objects consisting of attribute:value pairs between a server and a web application as an alternative to XML. JSON, while it is originally derived from JavaScript, is a language-independent data format. Code for parsing and generating JSON data is available in many programming languages.

Share tech news, updates, or what's on your mind.

Sign up to Post

I have a working Jquery modal dialog which includes a form to collect a contacts address. At the top of the form is a drop down list which returns pre-defined addresses and a 'Use Address' button (id="signal).  The user can choose a pre-defined address if they wish and click the 'Use Address' button which takes the address values and pre-populates the form, thereby, saving the user from having to type in the address manually.

The html for modal form is
<div id="addcontact-window" title="Add Agency Contact">
    <div align="center">
    <p id="errors6"></p>
    </div>
    <form id="addcontactForm" name="addcontactForm" action="" method="post">
    <div id="addcontactFormBody"></div> 
    </form>
    </div>

Open in new window


The jquery code which declares/defines the dialog is:

$("#addcontact-window").dialog(
                        {
                        autoOpen: false,
                        maxWidth:850,
                        maxHeight: 700,
                        width: 850,
                        height: 700,
                        draggable: true,
                        modal: true,
                        buttons: {
                          "Save": function () 
                          { 
                          $.post("./add_agencycontact_process.php", $("#addcontactForm").serialize(), function(response)
                            {
                            if(!response)
                            {
                            

Open in new window

0
Free Tool: SSL Checker
LVL 9
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

I have a web part page displaying 5 web parts. Four of the web parts (Efforts, Phases, Capture Points & Areas) are "provider" web parts, and come from lists that are the sources of 4 lookup columns in the 5th "consumer" web part (Lessons Learned).

The provider web parts are displaying the Title column from the lists.

The Using Javascript/jQuery, I "connected" the 4 provider web parts to the consumer web part, such that when you click on a Title column value, the consumer web part is filtered to show only those records that have the clicked value in the relevant metadata column.

All that is working very nicely.

Now, my requirement is to go one step further, and display the number of items that will be displayed if you click on a Title column value in any of the 4 web parts. If there are none, a "0" should be displayed.

I've constructed a lists service query that successfully returns the number of items that exist for a given, hard-coded, metadata value:
[SiteURL]/_vti_bin/listdata.svc/[ListName]/$count?&$filter=Effort/Title eq 'AAA'

So, the goal is to display such an item count beside the corresponding provider web part value, such as:
Efforts web part:
AAA (10) //assuming there are 10 items in the consumer web part tagged with Effort 'AAA'

Now, I'm bumping up against the current limit of my abilities.

I know that I need code (javascript, rest, ajax, json) for each provider web part with looping to cycle through all of the TD cells that have …
0
Oh men,
Im wondering it is a free plugin or some calendar for  an consulting room apointment
its any idea or recomendation if its for free or open source better
regards
0
I am using Javascript, HTML, Json and PHP.  The emails were sending but now they are not.  Any help is appreciated.  Thank you.

www.mediascrubber.com/videos.html


<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<script>
$(function() {
  $("#myform").on('submit', function(e) {
    e.preventDefault();
    $.ajax({
      url: '//jsbin.com/vufeyag.json',
      dataType: 'json',
      data: $("#myform").serialize()
    }).done(function(d) {
      if (d.success==true) {
        $("#myform").hide();
        $("#results").text("Thanks!").show();
      }
    });
  });
});
</script>>

Open in new window


<?php

$webmaster_email = "ds@mediascrubber.com";
$email_address = $_REQUEST['email_address'] ;

function isInjected($str) {
	$injections = array('(\n+)',
	'(\r+)',
	'(\t+)',
	'(%0A+)',
	'(%0D+)',
	'(%08+)',
	'(%09+)'
	);
	$inject = join('|', $injections);
	$inject = "/$inject/i";
	if(preg_match($inject,$str)) {
		return true;
	}
	else {
		return false;
	}
}


if (!isset($_REQUEST['email_address'])) {
header( "Location: $feedback_page" );
}
elseif ( isInjected($email_address) ) {
header( "Location: $error_page" );
}
else {
mail( "$webmaster_email", "Subscruber",
 
   "From: $email_address" );
   

}
$jsonurl = "http://api.wipmania.com/json";
$json = file_get_contents($jsonurl);
var_dump(json_decode($json));
?>

Open in new window


<form id="myform" class="form-horizontal" action="send_mail.php" method="post">
				<div class="input-group">
                <input type="text" name="email_address" class="def-input" placeholder="Your Email Here">
                <span class="input-group-btn">
                <button class="btn-form btn" input type="submit">Subscribe</button>
                </span>
                
				</div>
                </form>
                <div id="results" style="display: none;"></div>

Open in new window

0
Hello

I'm busy on a project where i have read only access to an oracle database.
Got a running webserver (LAMP) with a running OCI8 connection.
I'm trying to get a select query result from the following:

TableA
ID
DOC_ID
Date
Type

TableB
ID
DOC_ID (references tableA)
FILE_NAME
FILE_ID
FILE_TYPE

TableB can contain more then one result for the same DOC_ID.

The goal is to get the data from TableA appended with the results from TableB where the DOC_ID is the same and get them into a JSON format.
Looking like

{
	"data": [{
		"ID": "123456",
		"DOC_ID": "789456",
		"Date": "2/1/2016",
		"Type": "PI",
		"FILE_NAME": [
			"File1.pdf", "File2.docx"
		],
		"FILE_TYPE": [
			"PDF", "DOCX"
		],
		"FILE_ID": [
			"453215", "654687"
		]
	}, {
		"ID": "544569",
		"DOC_ID": "001223",
		"Date": "2/8/2016",
		"Type": "PI",
		"FILE_NAME": [
			"File1.txt"
		],
		"FILE_TYPE": [
			"TXT"
		],
		"FILE_ID": [
			"453215"
		]
	}, {
		"ID": "2225599",
		"DOC_ID": "0148966",
		"Date": "2/1/2017",
		"Type": "PI",
		"FILE_NAME": [
			"File1.xml", "File2.xml", "File3.xml"
		],
		"FILE_TYPE": [
			"XML", "XML", "XML"
		],
		"FILE_ID": [
			"00147788", "00114455", "00113210"
		]
	}]
}

Open in new window


Any advise on how to best go about this is welcome.
0
I have a very simple JSON feed and have been able to parse the feed using the below code. However, when the script gets to the "OFFERS" structure, it won't output the results cause it sees the brackets [ ] and is treating the data as a LIST of objects under OFFERS instead of objects like they would be under normal braces { }. I don't know how to get Coldfusion to properly give me the subitems of OFFERS.  You can easily see the feed using the link I provide also.

<cfoutput>
<cftry>
	<cfhttp url="https://rest.bandsintown.com/artists/spencerkane/events?app_id=day6mgmt&date=2017-08-19" result="httpResult" charset="utf-8" method="get"/>
 	<cfset BITdata = deserializeJSON(httpResult.filecontent)/>
	<cfloop array="#BITdata#" index="post">
		<cfif StructKeyExists(post, "datetime")>
			<cfset event_date = post.datetime>
		<cfelse>
			<cfset event_date = "">
		</cfif>
		<cfif StructKeyExists(post, "venue") and StructKeyExists(post.venue, "name")>
		    <cfset ev_title = post.venue.name>
		<cfelse>
            <cfset ev_title = "">
		</cfif>
		<cfif StructKeyExists(post, "venue") and StructKeyExists(post.venue, "city")>
			<cfset city = post.venue.city>
		<cfelse>
			<cfset city = "">
		</cfif>
		<cfif StructKeyExists(post, "venue") and StructKeyExists(post.venue, "region")>
			<cfset region = post.venue.region>
		<cfelse>
			<cfset region = "">
		</cfif>
		<cfif StructKeyExists(post, "offers[url]")>
		<cfset tickets = post.offers[url]>
			<cfelse>
		<cfset tickets = "">
		

Open in new window

0
In my .net c# project I have two jason like this

Json1
{"WindowsServices":[{"name":"SNMP","statusID":"1","StatusMsg":"Stopped","FullStatus":"SNMP,1"},{"name":"SNMPTRAP","statusID":"1","StatusMsg":"Stopped","FullStatus":"SNMPTRAP,1"}]}

Open in new window


Json2
{"WindowsServices":[{"name":"SNMP","statusID":"4","StatusMsg":"Running","FullStatus":"SNMP,4"},{"name":"SNMPTRAP","statusID":"1","StatusMsg":"Stopped","FullStatus":"SNMPTRAP,1"}]}

Open in new window


I need to compare this to json and get the result of the modified part oly
{"WindowsServices":[{"name":"SNMP","statusID":"4","StatusMsg":"Running","FullStatus":"SNMP,4"}]}

Open in new window



Thank you for your help!!
0
<cfoutput>
<cftry>
	<cfhttp url="https://rest.bandsintown.com/artists/spencerkane/events?app_id=day6mgmt&start_date=2017-01-01" result="httpResult" charset="utf-8" method="get"/>
 	<cfset BITdata = deserializeJSON(httpResult.filecontent)/>
	<cfloop array="#BITdata#" index="post">
		<cfif StructKeyExists(post, "datetime")>
			<cfset event_date = post.datetime>
		<cfelse>
			<cfset event_date = "">
		</cfif>
		<cfif StructKeyExists(post, "venue.name")>
		    <cfset ev_title = post.venue.name>
		<cfelse>
            <cfset ev_title = "">
		</cfif>
		<cfif StructKeyExists(post, "venue.city")>
			<cfset city = post.venue.city>
		<cfelse>
			<cfset city = "">
		</cfif>
		<cfif StructKeyExists(post, "venue.region")>
			<cfset region = post.venue.region>
		<cfelse>
			<cfset region = "">
		</cfif>
		<cfif StructKeyExists(post, "offers.url")>
		<cfset tickets = post.offers.url>
			<cfelse>
		<cfset tickets = "">
			</cfif>

<!--- FEED OUTPUT --->        
<cfif not event_date is "">		
#event_date#<p>
#ev_title#<p>
#city#<p>
#region#<p>
#tickets#
<hr />
</cfif>		
	</cfloop>

	<cfcatch type="any">
		<p>
			<cfdump var="#cfcatch#" />
			#LSDateFormat(Now(), "dd-mm-yyyy")# #lsTimeFormat(Now(), "HH:mm")#<br />
			<a href="##">
				Oh, sorry... I can't connect to Bandsintown
			</a>
		</p>
	</cfcatch>

</cftry>
</cfoutput>

Open in new window


My output only gives me the datetime and none of the other structure data even though the raw feed in a browser window definitely shows there is more data to be displayed. I am using Adobe's output structure of data.struct1.substruct but it doesn't display anything.
0
Oh men,
Im wondering if you guys can give me some advice and examples of how i can position my web page in the proper manner,
some tricks or best practices for positioning my page locally
regards
0
Hi guys,

I seem to be having an issue with my site, where iradio.ie/listen will be hammered after a while, however if i turn on my cloudfare to "I'm under attack" it will work fine but will display a message which in turn deters visitors, i think it is to do with my player here http://iradio.ie/newPlayer but maybe the fact that the iradio app is also pointing to http://iradio.ie/listen to get the audio streams, it is not able to handle the traffic or maybe its just down to poor config?

Any help would be greatly appreciated
0
Want Experts Exchange at your fingertips?
LVL 9
Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

hi
i have a method that should display the fist 2 results and when i press the more results button it should display the list with the added results. i log the data in initial step, and it is ok, then after the press it is ok. but when i want to loop the results and display them i get [object Object]. when i try the async pipe i get:
InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'

if i try the json pipe i get:
Converting circular structure to JSON
    at Object.stringify (<anonymous>)

i attach the image that show that the console results are ok.

this is the method:
  limit:BehaviorSubject<number> = new BehaviorSubject<number>(2);
  lastKey:string = '';
  queryable:boolean = true;

  paginationResults(){

    this.getLastKey();

    let list =  this.db.list('playlists', {
      query: {
        orderByKey: true,
        limitToFirst: this.limit,
      }
    });

    
  return list.subscribe(
      (data) => {
        console.log('returned data: ',  data);
        if(data.length > 0){
          //if the lastkey === to the last key in the database = stop query
          if(data[data.length - 1].$key === this.lastKey){
            this.queryable = false;
          }else{
            this.queryable = true;
          }
        }
      }
    );

  }

  getLastKey(){
    this.db.list('playlists',{
      query: {
        orderByKey: true,
        limitToLast: 1 //that get us the last key of the list
      }
    }).subscribe(
      (data) => {
        

Open in new window

0
I am trying to change a SP so that the email generated is an array, currently is just one fixed entry, the current syntax works but doesnt work with the API because the email needs to be an array.

Here is the current SP which works fine with a fixed email :
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO


ALTER PROCEDURE [dbo].[api_cc_all_active_contacts] 
AS
    DECLARE @json_result [NVARCHAR](MAX) = '';
    DECLARE @json_resultot [NVARCHAR](MAX) = ''; 

   SELECT   @json_result += CASE WHEN LEN(@json_result) = 0 THEN ''
                                ELSE ', 
'
                           END + '[{"email_addresses":"' + a.Email
                           + '","first_name": "' + ISNULL(a.FirstNm,'')
                           + '","last_name": "' + ISNULL(a.LastNm,'')
                           + '", "custom_fields":[ {"name": "contact_status", "value":"'
                           + CAST(ISNULL(a.Archivedcont,'0') AS varchar(10))
                           + '" },{"name": "country_of_birth", "value":"'
                           + ISNULL(a.PobCountry,'')
                           + '" }, {"name": "nationality", "value":"' + ISNULL(a.Nationality,'')
                           + '" }, {"name": "immigration_status", "value":"'
                          + ISNULL(a.NiStatus,'')
                           + '" }, {"name": "employer", "value":"' + ISNULL(b.MaidenNm,'') + '" } ]}]'
    FROM   dbo.Users a
           LEFT JOIN Users AS b ON b.UserId = a.EmployerId
    

Open in new window

0
1
Hi,

I'm looking to use the GoogleFinance module
https://github.com/hongtaocai/googlefinance

to record the stock price every few minutes into a MySQL database

From the documentation I can see that it will require a list of stocks  - that I will keep in csv file

I'm having difficulty parsing the JSON that comes back in order read it into a variable.
'TypeError: list indices must be integers, not str'

Can anyone direct me to some resources that might give me a steer on how best to achieve this?

I will look to create a table for each stock being tracked
0
I am displaying records from the database like this:

$(document).ready(function(){
			$.ajax({
				url: 'functions/list-articles-delete.php',
				dataType: 'json',
				method: 'POST',
				success: function(data) {
				 $.each(data, function(item){
					var tr_str = "<tr>"
					+ "<td>" + data[item].n_title + "</td>"
					+ "<td>" + data[item].n_dateTime + "</td>"
					+ "<td><button class='btn btn-danger' id='deletebut' data-id='" + data[item].id + "'>Delete</button></td>";
					 $( "#output" ).append(tr_str);
						
					 $( "#deletebut" ).on('click', function(){
						// display id of associated record
				}); 
			});			
		},
	});
});

Open in new window


When I click on any of the buttons I want it to console.log() the id of the associated record but not quite sure how to do this?
0
Hello,
  I am using swagger - YAML and I need some help on how to define  a json response object


Here is the JSON:

{
    "keywords": [],
    "distance": "25",
    "jobType": "all",
    "sectorId": "0",
    "location": {
        "lat": "33.7489954",
        "lng": "-84.3879824",
        "name": "Atlanta, GA"
    }
}

please note the keywords can be an empty array [] or have value like ['a','b','c']

Thanks for your help
0
#TodayILearned that #OData presents a problem for #XSLT. The #JSON element named "@odata.context" can't be translated into an #XML element with the same name, using XSLT 2 or 3 as provided in #Java by #Saxonica.
 
The problem is that XSLT uses that @ in XPATH statements to match element attributes, and in other places within curly brackets, like {@attribute}, to copy that attribute's content into the output.
 
The solution is to differentiate between nodes/attributes that do, and ones that don't contain an @-sign,  and either replace() or translate() that into something else.
 
In my case, I use fx:json-to-xml() from XSLT3, implemented by Saxonica, to transform received JSON-formatted data into raw XML. This leads to a map element that contains elements array, boolean, map, null, number, and string. The JSON element names become the XML elelements' "@key" attribute.
 
A 2nd XSL transformation produces the domain-specific XML-format. As stated above, we must take heed with producing the "@odata.context" element. This can occur, a.f.a.i.k., in either a null element or a string element. So, we differ between those with and without an "@" in the key attribute:
 
Without:
<xsl:template match="xf:string[@key][not(contains(@key, '@'))]">
<xsl:element name="{@key}">
<xsl:value-of select="text()" />
</xsl:element>
</xsl:template>
 
With:
<xsl:template match="xf:string[@key][contains(@key, '@')]">
<xsl:variable name="newName"><xsl:value-of select="translate(@key, '@', '')" …
0
 

Author Comment

by:A.E. Veltstra
Hi, Andrew Leniart. Funny, we have the same first name.
 
Thank you for your concern. I did search before I found a way to solve my problem and published it. As far as the search could tell me, I'm literally the first person to encounter and solve this problem. Hence the publication.
0
 
LVL 11

Expert Comment

by:Andrew Leniart
My apologies Andrew, I didn't read your entire post carefully enough and took it to be a problem you were still trying to solve. I think the hash tag # at the start threw me off! These new fandangled ways you younger generation have of talking can get confusing for oldies like me! lol..

Cheers :)
1
Hello nodejs experts

Is there is anything more on node js standards?  


All urls must be in lower case

Ex: /notification/sendotp

Use HTTP verbs (GET, POST, PUT, DELETE) to operate on the collections and elements.

Use GET – for retrieving single or list data

Use POST – for create data

Use PUT – for update data

Use DELETE – for delete data

HTTP METHOD

POST

GET

PUT

DELETE

CRUD OP

CREATE

READ

UPDATE

DELETE


URLs should include nouns, not verbs in API names. Avoid get,update,save, delete, list in API names.

Maintain singular and plural nouns for APIs.

Ex: for single image retrive – GET - /user/image

For list of images – GET – user/images

User Token must be in headers only. Not as path param or in json body

Use resource, sub-resources for relations

Ex: for user videos use - /user/videos

Put the version number at the base of your URL. /v1/user/images

Controller will have only mandatory parameter validations and sending success, error responses no business logic. Use Service and Helper files for business logic. DAO for db calls

Handle Errors with HTTP status codes

200 – OK – Everything is fine. Created, Saved, Data found

400 – Validations Failed, Missing Mandatory Params, No data found, User already exists, already voted, in valid comment, comment not allowed within a hour, invalid user, invalid video, Video not found

500 – Unknown error, Database error, ES down, timeout from third-party. …
0
I am trying to create a Json object in C# that I will convert to XML.   I have a repeating set of Fees that I need to add to the json object.

Here is my code so far:

root.Deal.Fees = new ExpandoObject();
List<ExpandoObject> feeArray = new List<ExpandoObject>();

foreach (DataRow ro in ds.Tables["fees"].Rows)
{
    root.Deal.Fees.DealFees.Fee.Description = ro["fee_type"].ToString();;
    root.Deal.Fees.DealFees.Fee.Amount = ro["amount"].ToString();

feeArray.Add(root.Deal.Fees);
}

Open in new window


No sure what else is needed.   Supply a different example if that is easier for you.
Thank you
0
Learn by Doing. Anytime. Anywhere.
Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

I am trying to run json linq query in Visual Studio 2008. I am getting the error :

select is not a member of newtonsoft.json.linq.array

Below is my code

Dim APIURL As String = "https://mydomain/api/v1/enrollments/search?id=12345"
            Dim req As WebRequest = WebRequest.Create(APIURL)
            req.ContentType = "application/json; charset=utf-8"
            req.Credentials = New System.Net.NetworkCredential("xyz", "123")
            req.Method = WebRequestMethods.Http.Get

            Dim text As String = ""
            Dim dt As DataTable = New DataTable
            Dim res As Stream = req.GetResponse().GetResponseStream
            Dim reader As New StreamReader(res)
            Dim response As String = reader.ReadToEnd()

            reader.Close()
            res.Close()

              Dim parsedObject = JObject.Parse(response)

            Dim docs = JArray.FromObject(parsedObject("enrollments")).Select(Function(x) x.ToObject(Of jSonClass.Enrollment)()) 'Error here
EE_json.txt
0
So, I am really trying to get my head around JSON and I have tried this which works but I wanted to know if there is a better way to do it or if this okay. I am actually playing around with developing a hybrid mobile app which uses a php and mysql backend. I have to use ajax to retrieve data and I want to also use JSON.

This is the jQuery/Ajax. The double dollar signs are not a typo, that is the correct syntax for the application but it is identical to jQuery as far as I know.

$$( "#submit" ).click(function(e){
		$$.ajax({
			url:"content.php",
			type:"POST",
			dataType:"json",
			success: function(data) {
				var len = data.length;
				for(var i = 0; i<len; i++) {;
					var user_name = data[i].user_name;
					$$( "#phpcontent" ).append(`
					<li class="item-content">
						<div class="item-inner">
						<div class="item-title">${user_name}</div>
						</div>
					</li>
					`);
				}
			}
		});
	});

Open in new window


This is the php for content.php

$stmt = $link->prepare("SELECT `user_name` FROM `users` ORDER BY `user_name` DESC");
$stmt->execute();
$result = $stmt->get_result();
$numRows = $result->num_rows;
if($numRows > 0) {
	while($row = $result->fetch_assoc()) {
		$user_name = sanitize($row['user_name']);
		
		$return_array[] = array(
		
			"user_name" => $user_name
		
		);
	}
}
$stmt->close();
echo json_encode($return_array);

Open in new window


What I have noticed in all the examples I have looked at is that the database results have to be put into an array in order to use json_encode. Am I correct in saying that or is it just a coincidence that every example I looked at did that?
0
http://maps.aerophotos.cf/test.
Basically make the markers update every second or so from the JSON file aswell as display the data in the JSON file i.e altitude callsign etc when clicking on marker.
0
I have a simple html page that uses bootstrap grid.

Each page of the grid I've labelled as a section.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>

	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

  </head>
  <body>

  <div class="container">

  	<div class="row">
  		<div class="col-md-4">Section 1</div>
  		<div class="col-md-4">Section 2</div>
  		<div class="col-md-4">Section 3</div>
  	</div>

  	<div class="row">
  		<div class="col-md-6">Section 4</div>
  		<div class="col-md-6">Section 5</div>
  	</div>

  </div>
 

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
   	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  </body>
</html>

Open in new window


Example data:

{
  "section": "section1",
  "position": "5"
}

Open in new window


What I want to do is to load the different grid parts by reading json data.

So basically, the page loads, reads the json data which contains the positions of the sections and then populates the website.
0
I am trying to get a json to vb.net class.
I have used the Visual studio converter for this and generated the class, but it is not working.
 The commented   ' Public Property Wlisting() As WooData does not work,
I have tried different methods of calling an array or a list but always get the same error.  The Json that come over appears correctly formed, it is the inability to get it into a class which is the problem.

The line :

  Dim WooResponse = JsonConvert.DeserializeObject(Of WooCommerceData.Results)(result)

gives the following error:
Newtonsoft.Json.JsonSerializationException: 'Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'Zetsy.WooCommerceData.Results' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.

To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.

Zit appears I should be calling this as a differnt type of list, but what I have tried gives the same error
=========================================================================


The class is the following:

Namespace WooCommerceData
    Public Class Results
        Public Property Wlistings As List(Of WooData)
        ' Public …
0
I am using a webclient to send data via JSON to tell the server what I want to have them return to me. However, The API requires I use a GET. But I don't know how to define a GET in the UploadData or even DownloadString methods. How can I issue a GET at the same time I am also sending JSON?

If I pass all the parameters as query string parameters it also fails, so I have to issue the call using JSON data in the body.

thanks!
0

JSON

488

Solutions

535

Contributors

JavaScript Object Notation, or JSON, is human-readable text used when transmitting data objects consisting of attribute:value pairs between a server and a web application as an alternative to XML. JSON, while it is originally derived from JavaScript, is a language-independent data format. Code for parsing and generating JSON data is available in many programming languages.

Related Topics

Top Experts In
JSON
<
Monthly
>