{"id":15606,"date":"2019-05-13T12:28:46","date_gmt":"2019-05-13T15:28:46","guid":{"rendered":"https:\/\/blog.hostinger.io\/pt-tutoriais\/?p=15606"},"modified":"2023-08-31T18:38:15","modified_gmt":"2023-08-31T21:38:15","slug":"o-que-e-json","status":"publish","type":"post","link":"\/pt\/tutoriais\/o-que-e-json\/","title":{"rendered":"O que \u00e9 um arquivo JSON? Tudo o que voc\u00ea precisa saber"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">O <\/span><strong>JSON<\/strong><span style=\"font-weight: 400\"> (JavaScript Object Notation) \u00e9 um formato de arquivo para manter e trocar informa\u00e7\u00f5es leg\u00edveis pelas pessoas. O arquivo cont\u00e9m apenas texto e usa a extens\u00e3o <\/span><b>.json<\/b><span style=\"font-weight: 400\">.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Neste artigo, voc\u00ea vai aprender &nbsp;sobre o JSON e para que ele \u00e9 usado. Al\u00e9m disso, tamb\u00e9m vai ver como ele pode melhorar o desempenho do seu site.<\/span><\/p>\n\n\n\n\n\n\n\n\n<h2 class=\"wp-block-heading h-t-title-2\" id=\"h-o-que-e-json-e-para-que-serve\"><b>O Que \u00e9 Json e Para Que Serve<\/b><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">O JSON \u00e9 um formato que armazena informa\u00e7\u00f5es estruturadas e \u00e9 principalmente usado para transferir dados entre um servidor e um cliente.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">O arquivo \u00e9 basicamente uma alternativa simples e mais leve ao XML (<\/span><i><span style=\"font-weight: 400\">Extensive Markup Language<\/span><\/i><span style=\"font-weight: 400\">), que tem fun\u00e7\u00f5es similares.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Desenvolvedores usam o JSON para trabalhar com <\/span><strong><a data-click-id=\"hgr-post-content-link-ajax\" href=\"https:\/\/blog.hostinger.io\/pt-tutoriais\/o-que-e-ajax\/\" target=\"_blank\" rel=\"noopener\">AJAX<\/a><\/strong><span style=\"font-weight: 400\"> (<\/span><i><span style=\"font-weight: 400\">Asynchronous JavaScript and XML<\/span><\/i><span style=\"font-weight: 400\">). Esses formatos trabalham juntos para conseguir um carregamento ass\u00edncrono de dados armazenados.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Isso significa que um site pode atualizar suas informa\u00e7\u00f5es sem precisar recarregar a p\u00e1gina que voc\u00ea est\u00e1 visitando.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Esse processo \u00e9 mais f\u00e1cil de se fazer com o JSON do que em XML\/RSS. E, hoje, como v\u00e1rios sites est\u00e3o usando o AJAX, o arquivo <\/span><b>.json <\/b><span style=\"font-weight: 400\">vem se tornando muito popular.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Al\u00e9m disso, ele permite que os usu\u00e1rios pe\u00e7am dados de <\/span>dom\u00ednios<span style=\"font-weight: 400\"> diferentes com um m\u00e9todo chamado de <\/span><strong><a data-click-id=\"hgr-post-content-link-jsonp\" href=\"https:\/\/pt.wikipedia.org\/wiki\/JSONP\" target=\"_blank\" rel=\"noopener\">JSONP<\/a><\/strong><span style=\"font-weight: 400\"> aplicando tags <\/span><b>&lt;script&gt;.<\/b><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Caso contr\u00e1rio, voc\u00ea n\u00e3o vai conseguir transferir dados atrav\u00e9s de dom\u00ednios devido \u00e0 <\/span><strong><a data-click-id=\"hgr-post-content-link-politica-da-mesma-origem\" href=\"https:\/\/pt.wikipedia.org\/wiki\/Pol%C3%ADtica_de_mesma_origem\" target=\"_blank\" rel=\"noopener\">pol\u00edtica da mesma origem<\/a><\/strong><span style=\"font-weight: 400\">.<\/span><\/p>\n\n\n        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Leitura Sugerida                <\/p>\n            <\/div>\n            <p class=\"protip__content\"><a data-click-id=\"hgr-post-content-link-como-registrar-um-dominio\" href=\"\/tutoriais\/como-registrar-um-dominio\">Como Registrar um Dom\u00ednio<\/a><\/p>\n                    <\/div>\n        \n\n\n\n<h2 class=\"wp-block-heading h-t-title-2\" id=\"h-sintaxe-do-json\"><b>Sintaxe do JSON<\/b><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Para criar corretamente o formato <\/span><b>json<\/b><span style=\"font-weight: 400\">. Voc\u00ea tem que seguir exatamente a sua sintaxe.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Existem dois elementos centrais em um objeto JSON: <\/span><b><i>Keys<\/i><\/b><span style=\"font-weight: 400\"> (chaves) e <\/span><b><i>Values<\/i><\/b><span style=\"font-weight: 400\"> (valores).<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><b>Keys<\/b><span style=\"font-weight: 400\"> devem ser strings (linhas). Elas cont\u00eam uma sequ\u00eancia de caracteres cercadas por aspas.<\/span><\/li>\n\n\n\n<li><b>Values<\/b><span style=\"font-weight: 400\"> s\u00e3o um tipo v\u00e1lido de dados JSON. Eles podem ter um formato de <\/span><i><span style=\"font-weight: 400\">array, object, string, boolean, number ou null<\/span><\/i><span style=\"font-weight: 400\">.<\/span><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Um objeto JSON inicia e termina com chaves <\/span><b>{}<\/b><span style=\"font-weight: 400\">. Ele tem dentro dois ou mais pares de <\/span><b>key\/value<\/b><span style=\"font-weight: 400\">, com uma<\/span><b> v\u00edrgula<\/b><span style=\"font-weight: 400\"> para separ\u00e1-los. Cada chave \u00e9 seguida por<\/span> <span style=\"font-weight: 400\">dois <\/span><b>pontos<\/b><span style=\"font-weight: 400\"> para diferenciar o valor.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Veja um exemplo:<\/span><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\"city\":\"New York\", \"country\":\"United States \"}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Temos dois pares de key\/values aqui: <\/span><b>city<\/b><span style=\"font-weight: 400\"> e <\/span><b>country <\/b><span style=\"font-weight: 400\">s\u00e3o as keys; <\/span><b>New York<\/b><span style=\"font-weight: 400\"> e <\/span><b>United States<\/b><span style=\"font-weight: 400\"> s\u00e3o os values.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading h-t-title-3\" id=\"h-tipos-de-valores\"><b>Tipos de Valores<\/b><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Valores cont\u00eam um tipo v\u00e1lido de dados JSON, como:<\/span><\/p>\n\n\n\n<h4 class=\"wp-block-heading h-t-title-4\" id=\"h-array\"><b>Array<\/b><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Um array \u00e9 uma cole\u00e7\u00e3o ordenada de valores. \u00c9 cercado por <strong>colchetes <\/strong><\/span><b>[]<\/b><span style=\"font-weight: 400\"> e cada valor dentro \u00e9 separado por uma v\u00edrgula.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Um valor de array pode conter objetos JSON. Isso significa que ele usa o mesmo conceito de key\/value. Por exemplo:<\/span><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\"students\":[      \n{\"firstName\":\"Tom\", \"lastName\":\"Jackson\"},\n{\"firstName\":\"Linda\", \"lastName\":\"Garner\"},\n{\"firstName\":\"Adam\", \"lastName\":\"Cooper\"}\n]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">A informa\u00e7\u00e3o entre colchetes \u00e9 um array, que tem tr\u00eas objetos.<\/span><\/p>\n\n\n\n<h4 class=\"wp-block-heading h-t-title-4\" id=\"h-object\"><b>Object<\/b><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Um objeto cont\u00e9m uma key e value. Tem dois pontos depois de cada key e uma v\u00edrgula depois de cada value, que tamb\u00e9m diferencia cada objeto. Ambos est\u00e3o dentro de aspas.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Object, como um value, deve seguir as mesmas regras que um objeto. como:<\/span><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\u201cemployees\u201d: {\"firstName\":\"Tom\", \"lastName\":\"Jackson\u201d}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Aqui, <\/span><b>employees<\/b><span style=\"font-weight: 400\"> \u00e9 a chave enquanto tudo dentro das chaves \u00e9 um objeto.<\/span><\/p>\n\n\n\n<h4 class=\"wp-block-heading h-t-title-4\" id=\"h-strings\"><b>Strings<\/b><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Uma string \u00e9 uma sequ\u00eancia definida de zero ou mais caracteres Unicode. \u00c9 colocado entre duas aspas duplas.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">O exemplo abaixo mostra que <\/span><b>Tom<\/b><span style=\"font-weight: 400\"> \u00e9 uma string, pois \u00e9 um conjunto de caracteres dentro de aspas duplas.<\/span><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\"firstName\":\"Tom\"<\/pre>\n\n\n\n<h4 class=\"wp-block-heading h-t-title-4\" id=\"h-number\"><b>Number<\/b><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Number em JSON deveria ser do tipo <\/span><b>inteiro <\/b><span style=\"font-weight: 400\">ou um tipo <\/span><b>fracionado<\/b><span style=\"font-weight: 400\">, como:<\/span><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\u201cage\u201d:\u201d30\u201d}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading h-t-title-4\" id=\"h-boolean\"><b>Boolean<\/b><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Voc\u00ea pode usar as op\u00e7\u00f5es <\/span><b>true <\/b><span style=\"font-weight: 400\">(verdadeiro) ou <\/span><b>false <\/b><span style=\"font-weight: 400\">(falso) como valor, seguindo:<\/span><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\u201cmarried\u201d:\u201dfalse\u201d)<\/pre>\n\n\n\n<h4 class=\"wp-block-heading h-t-title-4\" id=\"h-null\"><b>Null<\/b><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Esse formato mostra que n\u00e3o h\u00e1 informa\u00e7\u00e3o.<\/span><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\u201cbloodType\u201d:\u201dnull\u201d}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading h-t-title-2\" id=\"h-dados-json-armazenados\"><b>Dados JSON Armazenados <\/b><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Voc\u00ea tem duas formas de armazenar dados no JSON: <\/span><i><span style=\"font-weight: 400\">object<\/span><\/i><span style=\"font-weight: 400\"> e <\/span><i><span style=\"font-weight: 400\">array<\/span><\/i><span style=\"font-weight: 400\">. O primeiro se parece com isso:<\/span><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n\"firstName\":\"Tom\",\n\"lastName\":\"Jackson\",\n\"gender\":\"male\"\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">As Chaves <\/span><b>{}<\/b><span style=\"font-weight: 400\"> significam que \u00e9 um objeto JSON. Elas envolvem tr\u00eas pares de key\/value que s\u00e3o separados por v\u00edrgulas.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Em cada par, voc\u00ea tem as keys (<\/span><i><span style=\"font-weight: 400\">firstName<\/span><\/i><span style=\"font-weight: 400\">, <\/span><i><span style=\"font-weight: 400\">lastName<\/span><\/i><span style=\"font-weight: 400\"> e <\/span><i><span style=\"font-weight: 400\">gender<\/span><\/i><span style=\"font-weight: 400\">) seguidas por dois pontos para diferenciar de outros values (<\/span><i><span style=\"font-weight: 400\">Tom<\/span><\/i><span style=\"font-weight: 400\">, <\/span><i><span style=\"font-weight: 400\">Jackson<\/span><\/i><span style=\"font-weight: 400\">, <\/span><i><span style=\"font-weight: 400\">male<\/span><\/i><span style=\"font-weight: 400\">).<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Os values nesse exemplo s\u00e3o strings. \u00c9 por isso que eles tamb\u00e9m est\u00e3o entre aspas, semelhantes \u00e0s keys.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading h-t-title-2\" id=\"h-usando-arrays\"><b>Usando Arrays<\/b><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Outro m\u00e9todo de armazenamento de dados \u00e9 o array. Olhe para esse exemplo:<\/span><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n\"firstName\":\"Tom\",\n\"lastName\":\u201dJackson\u201d,\n\u201cgender\u201d:\u201dmale\u201d,\n\"hobby\":[\"football\", \"reading\", \"swimming\"]\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">O que diferencia isso do m\u00e9todo anterior \u00e9 o quarto par de key\/value. <\/span><b>Hobby<\/b><span style=\"font-weight: 400\"> \u00e9 a key e existem v\u00e1rios values (<\/span><i><span style=\"font-weight: 400\">football<\/span><\/i><span style=\"font-weight: 400\">, <\/span><i><span style=\"font-weight: 400\">reading<\/span><\/i><span style=\"font-weight: 400\">, <\/span><i><span style=\"font-weight: 400\">swimming<\/span><\/i><span style=\"font-weight: 400\">) entre colchetes, que representam um array.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Ele pode ser \u00fatil quando emparelhado com o JSONP para resolver o problema dos dom\u00ednios diferentes<\/span><span style=\"font-weight: 400\">.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Esse processo funciona usando o que \u00e9 chamado de <\/span><b>callbacks<\/b><span style=\"font-weight: 400\">, que solicitar\u00e1 um item espec\u00edfico no Array sem obter um erro da mesma origem.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">E, finalmente, o Array tamb\u00e9m suporta o <\/span><strong><a data-click-id=\"hgr-post-content-link-comando-loop-for-bash\" href=\"https:\/\/blog.hostinger.io\/pt-tutoriais\/bash-for-loop-guia\/\" target=\"_blank\" rel=\"noopener\">comando Loop for Bash<\/a><\/strong><span style=\"font-weight: 400\">, permitindo que voc\u00ea execute repetidos comandos para pesquisar m\u00faltiplos dados. Isso torna o processo mais r\u00e1pido e mais eficaz.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a data-click-id=\"hgr-post-content-link-pt-hospedagem-barata\" aria-label=\"Hospedagem barata\" href=\"\/pt\/hospedagem-barata\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-32927\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading h-t-title-2\" id=\"h-conclusao\"><b>Conclus\u00e3o<\/b><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Como voc\u00ea pode ver, a extens\u00e3o JSON \u00e9 uma ferramenta \u00fatil para a troca rec\u00edproca de dados. Ele tem muitas vantagens:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ele pode carregar informa\u00e7\u00f5es de forma ass\u00edncrona para que seu site seja mais responsivo e possa lidar com o fluxo de dados com mais facilidade.<\/li>\n\n\n\n<li>Voc\u00ea pode tamb\u00e9m us\u00e1-lo para superar problemas de <a data-click-id=\"hgr-post-content-link-registro-de-dominio-web\" href=\"\/pt\/verificar-dominio\">registro de dom\u00ednio web<\/a> cruzado quando extrair informa\u00e7\u00f5es de outro site.<\/li>\n\n\n\n<li>O JSON \u00e9 simples e mais leve que o XML.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Esperamos que voc\u00ea tenha entendido melhor o JSON e esteja apto para gerenciar seu site de uma forma mais efetiva.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>O JSON (JavaScript Object Notation) \u00e9 um formato de arquivo para manter e trocar informa\u00e7\u00f5es leg\u00edveis pelas pessoas. O arquivo cont\u00e9m apenas texto e usa a extens\u00e3o .json. Neste artigo, voc\u00ea vai aprender &nbsp;sobre o JSON e para que ele \u00e9 usado. Al\u00e9m disso, tamb\u00e9m vai ver como ele pode melhorar o desempenho do seu [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/pt\/tutoriais\/o-que-e-json\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":92,"featured_media":15609,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"%title%","rank_math_description":"Uma p\u00e1gina feita em JavaScript e que seja leg\u00edvel pelas pessoas. Aprenda o que \u00e9 JSON e como essar esse formato de texto!","rank_math_focus_keyword":"o que \u00e9 json","_content_updated_date":"","footnotes":""},"categories":[7761,7710],"tags":[6526,6527,4793,6525],"class_list":["post-15606","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-desenvolvimento-de-sites","category-sites","tag-arquivo-json","tag-formato-json","tag-javascript","tag-json"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/what-is-json\/","default":1},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/o-que-e-json\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/quest-ce-que-json\/","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/que-es-json\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/apa-itu-json\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/what-is-json\/","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/what-is-json\/","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/what-is-json\/","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/what-is-json\/","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/what-is-json\/","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/what-is-json\/","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/what-is-json\/","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/que-es-json\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/que-es-json\/","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/que-es-json\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/o-que-e-json\/","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/posts\/15606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/users\/92"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/comments?post=15606"}],"version-history":[{"count":11,"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/posts\/15606\/revisions"}],"predecessor-version":[{"id":39719,"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/posts\/15606\/revisions\/39719"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/media\/15609"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/media?parent=15606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/categories?post=15606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/tags?post=15606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}