Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2013
    Thanked 0 Times in 0 Posts

    JSON response form server--Urgent

    Hi All,
    I'm copy an API on web browser (Its like this).I get response,

    I get response
    {"status": "ok", "version": "1.1.0"}

    I have sample other responses where I get by using cURL.

    I need to extract this data from the server and load it into another server.I'm horribly confused.

    Here's the whole picture.

    We have original data on server1
    We can access the server1 data using only API requests.I sent API request to server1 and got the responses in JSON.
    I need to extract the data from JSON responses and then load into SQL server which is on server2.
    I'm connected to server 2(that's where I have to write the code to extract the data)

    What is the best way to extract this data from server1 to server2?

    Should I write Java script/PHP to extract the data from server1 and load it into server2?

    Should it be written in Phython?or ......?

    Any ideas would be appreciated at this point of time.

    It's very urgent.

    Thank You.

  2. #2
    Master Coder sunfighter's Avatar
    Join Date
    Jan 2011
    Thanked 1,012 Times in 1,009 Posts
    I get response
    {"status": "ok", "version": "1.1.0"}
    I don't think that's correct. In this case i think json sends you a string that looks like that and you printed the string. Use PHP because you want to enter data into a database.

    Something to help you see whats going on:
    PHP Code:
    '{"status": "ok", "version": "1.1.0"}';  // THE VARIABLE $string IS WHAT IS SENT TO YOU

    $decoded json_decode($string);
    "Status: ".$decoded->{'status'}."<br />";
    "Version: ".$decoded->{'version'};

    $status $decoded->{'status'};
    $version $decoded->{'version'};


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts