Working HttpClient sample project?

  1. 5 months ago

    Currently the spotify tutorial project is no longer working.

    Is anyone willing and able to share a sample project which demonstrates how to use httpclient?

    I would like to find out whether i can communicate with the SIX saferpay payment gateway and also with a private webservice I created with Xojo.

    But I would need some jump-start, a working example, to grasp the Creo way of doing things.

  2. tbd

    Jun 16 User since 2016

    here is a quick demo that gets your IP and displays on screen

  3. Thanks tbd! Your example works fine. I don't get it (yet) how the result of the ipinfo.getjson request ends up on Label ip. Where is this magic happening?

    I also tried to modify the example in a way that I can retrieve pure data (no json), from here:

    https://dharma.ch/myip

    Any hint on how this would work?

  4. tbd

    Jun 16 User since 2016
    Edited 5 months ago by tbd

    @oliver@osswald.com you have the HTTPClient (where you set the host) and the Request (where you set the path on the host)

    on Request (I named it getjson) you have an event called NewValue that is called when the HTTPClient.Request is run (in my example from Window1.WillShow)

    for dharma.ch/myip you just have to change the host and path in HTTPClient and Request. and display the value instead of value['ip'] (as in my example the output is a JSON)

    hope it helps

  5. marco

    Jun 16 Administrator User since 2016

    Hi @oliver@osswald.com we'll update the Spotify tutorial pretty soon, only authentication part is missed but everything else will remain the same.

    Thanks a lot @tbd for the help.

  6. Okay, i get it! Thanks marco and tbd!

or Sign Up to reply!