JSON

JSON Veri Tipleri Nelerdir ?

JSON (JavaScript Object Notation) bir veri değişim biçimidir ve JavaScript dilinde kullanılır. JSON veri tipleri aşağıdaki gibi olabilir:

  1. string (metin): Metinler tırnak işaretleri içinde belirtilir. Örnek: “Sayfama Hoşgeldiniz”
  2. number (sayı): Sayılar tamsayı veya ondalıklı olabilir. Örnek: 342 veya 17.14
  3. object (nesne): Nesneler bir dizi anahtar-değer çiftlerinden oluşur. Örnek: {“isim”: “Çağrı”, “soyisim”: “Güngör”}
  4. array (dizi): Diziler virgülle ayrılmış değerlerden oluşur. Örnek: [1, 2, true, 4, “çağrı”]
  5. boolean (mantıksal değer): Boolean değerler true (doğru) veya false (yanlış) olabilir. Örnek: true
  6. null (boş): Null değeri belirtilen bir değerin olmadığını gösterir. Örnek: null

Not: JSON veri tipleri JavaScript veri tiplerine benzerdir, ancak fonksiyonlar ve undefined değerleri JSON içinde kullanılamaz

Örnek JSON url:https://go-apod.herokuapp.com/apod

Kod:

{"copyright":"Russell Croman","date":"2022-12-26","explanation":"The star at the center created everything.  Known as the Dragon's Egg, this star -- a rare, hot, luminous O-type star some 40 times as massive as the Sun -- created not only the complex nebula (NGC 6164) that immediately surrounds it, but also the encompassing blue halo. Its name is derived, in part, from the region's proximity to the picturesque NGC 6188, known as the fighting Dragons of Ara. In another three to four million years the massive star will likely end its life in a supernova explosion. Spanning around 4 light-years, the nebula itself has a bipolar symmetry making it similar in appearance to more common planetary nebulae - the gaseous shrouds surrounding dying sun-like stars. Also like many planetary nebulae, NGC 6164 has been found to have an extensive, faint halo, revealed in blue in this deep telescopic image of the region. Expanding into the surrounding interstellar medium, the material in the blue halo was likely expelled from an earlier active phase of the O-star. NGC 6164 lies 4,200 light-years away in the southern constellation of the Carpenter's Square (Norma).","hdurl":"https://apod.nasa.gov/apod/image/2212/DragonsEgg_Croman_4231.jpg","media_type":"image","service_version":"v1","title":"NGC 6164: Dragon's Egg Nebula and Halo","url":"https://apod.nasa.gov/apod/image/2212/DragonsEgg_Croman_960.jpg"}

 

0 0 votes
Article Rating
Subscribe
Bildir
guest
0 Yorum
Inline Feedbacks
View all comments