
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 208 Articles for JSON

1K+ Views
JSON can be abbreviated as JavaScript Object Notation. It means a script of a text file in a programming language to transfer and store the data. It is supported by the Python programming language using a built-in package named JSON. Its text is given in the quoted string format, which contains a key and value within the curly braces{}, which looks like a dictionary. To access a JSON document using Python, we have to use the JSON package. In this package, we have a method named dumps(), which is used to convert the Python tuple objects into the Java objects. ... Read More

1K+ Views
We can use python-jsonschema-objects which is built on top of jsonschema.The python-jsonschema-objects provide an automatic class-based binding to JSON schemas for use in Python.We have a sample json schema as followsschema = '''{ "title": "Example Schema", "type": "object", "properties": { "firstName": { "type": "string" }, "lastName": { "type": "string" }, "age": { "description": "Age in years", ... Read More

3K+ Views
There is no standard JSON format for dates. Although JavaScript does have a standard date format that is human readable, sorts correctly, includes fractional seconds(which can help re-establish chronology) and conforms to ISO 8601. You can convert a Python date to the JS date format using the strftime function and deserialize it using the client that needs this date. To get an ISO 8601 date in string format in Python 3, you can simply use the isoformat function. It returns the date in the ISO 8601 format. For example, if you give it the date 31/12/2017, it'll give you the ... Read More

919 Views
json is simplejson, added to the stdlib. But since json was added in 2.6, simplejson has the advantage of working on more Python versions (2.4+).simplejson is also updated more frequently than Python. Although they are the same, the version included in the stdlib doesn't include the latest optimizations. So if you need (or want) the latest version, it's best to use simplejson itself, if possible.A good practice, is to use one or the other as a fallback. For example,try: import simplejson as json except ImportError: import json

541 Views
This can be done in multiple ways. One of common approach would be by passing user name/password in URL.$.ajax({ url : "http://user:password@url/SERVICE?$format=json", type: "GET", //or POST? dataType: "jsonp", success: function(){alert("ok")}, error: function(){alert("error")} })

2K+ Views
In this article, we are going to learn how to convert a string to JSON in Python. JSON is a lightweight data interchange format that is used to read and write, and store data. Usually, we receive JSON data in the form of a string. To process it using a Python program, we need to convert the JSON string into an object, which can be stored in Python dictionaries and lists. This conversion can be done by using functions provided by the Python JSON module. Using Python json.loads() Function The Python json.loads() function is used to convert the JSON-formatted ... Read More

7K+ Views
To retrieve data from JSON file using jQuery and Ajax, use the jQuery.getJSON( url, [data], [callback] )The jQuery.getJSON( url, [data], [callback] ) method loads JSON data from the server using a GET HTTP request.Here is the description of all the parameters used by this method −url − A string containing the URL to which the request is sentdata − This optional parameter represents key/value pairs that will be sent to the server.callback − This optional parameter represents a function to be executed whenever the data is loaded successfully.Let’s say we have the following JSON content in result.json file −{ "name": "John", "age" : ... Read More

2K+ Views
You can use class ZCL_MDP_JSON Library that can encode/parse any JSON. JSON is supported natively in ABAP by the following features:With the use of JSON-XML- it is known as special XML format that can be used for JSON data to be described using an XML representation. By defining a mapping between ABAP types and JSON. This is used in serializations and deserializations using the identity transformation ID.As you can specify JSON data in different forms as an XML source in the statement CALL TRANSFORMATION and JSON can be specified as a target.Check out the following sample code:Example:DATA text TYPE string VALUE ... Read More