Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8595411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:25:36+00:00 2026-06-12T00:25:36+00:00

I am creating http_client object and making a GET request. Below is my code.

  • 0

I am creating http_client object and making a GET request. Below is my code.

$httpc = new HTTP_CLIENT();
$httpc->get("$endpointUrl?operation=getchallenge&username=$userName");
$response = $httpc->currentResponse();
print_r($response);
output: Array ( [url] => http://localhost:8888//webservice.php?operation=getchallenge&username=admin [code] => 200 [headers] => Array ( [date] => Thu, 27 Sep 2012 07:30:17 GMT [server] => Apache/2.0.52 (Win32) PHP/5.2.6 [x-powered-by] => PHP/5.2.6 [expires] => Thu, 19 Nov 1981 08:52:00 GMT [cache-control] => no-store, no-cache, must-revalidate, post-check=0, pre-check=0 [pragma] => no-cache [content-length] => 102 [connection] => close [content-type] => application/json ) [body] => {"success":true,"result":{"token":"50640089780c4","serverTime":1348731017,"expireTime":1348731317}} )

jsonResponse = Zend_JSON::decode($response['body']);

I tried to extract “body” part from this Array, but value i get is blank. Help me if you can.

Note : You can see the output having JUNK value at starting of [body] part.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:25:37+00:00Added an answer on June 12, 2026 at 12:25 am

    Since that is an API and they clearly have some BOM characters your should exatrct them and decode:

    $jsonResponse = Zend_JSON::decode(substr($response['body'], 6));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get a maximum recursion depth exceeded if a run the code below: from
I am using following plugin http://pinesframework.org/pnotify/ I am creating dialog using following jquery code..
I'm a bit new to Python dev -- I'm creating a larger project for
I installed SharePoint Foundation 2010 Client Object Model Redistributable with the intent of creating
I am creating a web service, I have added an operation which receive an
I have a strange problem with native Ajax request invoking. I am creating the
I am creating an HTTP client, which handles HTTP requests and responses with a
I am creating a general general mock-client for testing HTTP-interactions. For this, I would
I was creating a website http://tapasya.co.in and i found that this site has some
I want to know what is the best solution for creating ASP.NET HTTP Handler

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.