> If the website is returning JSON, if you can just pass $oResponse instead of 
> $response and 4D will do the "JSON Parse” for you automatically. 

Tim, thanks. At first I did not understand, but got it now...

                C_OBJECT($oResponse)
                HTTP Request(HTTP GET method;$url;$content;$oResponse)

The HTTP Request command sees JSON coming in and an object for the response and 
automatically parses it in the object…. Neat. Thanks.

John



> On Jun 2, 2019, at 9:36 AM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> On Jun 2, 2019, at 2:00 PM, JOHN BAUGHMAN wrote:
> 
>> Thanks Kirk. Yes after looking through the 2 I think zipcodeapi is the 
>> better choice. I registered my app and with a simple http request already 
>> have what I needed….
>> 
>>   C_TEXT($response)
>>   C_OBJECT($oResponse)
>>   $$zipcode:="96734"
>>   $clientKey:=“;alks;dlfakjldflajdkl"
>>   
>> $url:="https://www.zipcodeapi.com/rest/"+$clientKey+"/info.json/"+$zipcode+"/radians”
>>   HTTP Request(HTTP GET method;$url;$content;$response)
>> 
>>  $oResponse:=JSON Parse($response)
>>  $city:=$oResponse.city
>>  $state=$oResponse.state
>> 
>> Didn’t think it would be that easy. Hope this post helps someone else down 
>> the line.
> 
> I had the same experience with Twilio for sending SMS from 4D. It was so easy 
> to use HTTP Request when the website has a well designed API.
> 
> If the website is returning JSON, if you can just pass $oResponse instead of 
> $response and 4D will do the "JSON Parse” for you automatically. 
> 
> Tim
> 
> *****************************************
> Tim Nevels
> Innovative Solutions
> 785-749-3444
> timnev...@mac.com
> *****************************************
> 
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to