Posts:
Replies:
Daniel Castro · Jan 17
Daniel Castro · Jan 14
Because the correct address is : http://api.sidra.ibge.gov.br/values/t/1736/n1/all/v/all/p/all/d/v44%202,...
That C# code is not working anymore. They presented it just as a sample.
Anyway, as I posted here, the problem is solved. Thank you for your attention !
Daniel Castro · Jan 13
Problem solved !
/// Contém os dados do INPC para calculos financeiros Class User.TabelaINPC Extends (%Persistent, %JSON.Adaptor) { Property Mes As %Integer [ Required ]; Index MesIndex On Mes [ Unique ]; Property Descricao As %String [ Required ]; Property Valor As %Double [ Required ]; ClassMethod leINPC() As %Status { Set result = ##class(%Net.HttpRequest).%New() Set result.Server = "api.sidra.ibge.gov.br" set result.SSLConfiguration = "padrao" set result.Https = 0 --- HTTPS MUST Be ZERO, although there is a redirect to https in the browser set result.SSLCheckServerIdentity = 0 set result.FollowRedirect = $$$YES set result.ContentType = "application/json" TRY { set status = result.Get("/values/t/1736/n1/all/v/all/p/all/d/v44%202,v68%202,v2289%2013,v2290%202,v2291%202,v2292%202?formato=json") set response = result.HttpResponse.Data write "HTTP_CODE:"_result.HttpResponse.StatusCode,! set dados = {}.%FromJSON(response) set formatter = ##class(%JSON.Formatter).%New() do formatter.Format(dados) set iterator = dados.%GetIterator() while iterator.%GetNext(.key, .value) { write "element:"_key_"=/"_value_"/ ",!} } CATCH erro { write "ERRO:",! write erro.Name_", "_erro.Location_", error code "_erro.Code,! do $system.OBJ.DisplayError() RETURN erro.AsStatus() } Quit $$$OK }
Thank you for the help Timothy !
Followers:
Daniel has no followers yet.
Following:
Daniel has not followed anybody yet.
Global Masters badges:
Daniel has no Global Masters badges yet.
Thank you !