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 7716175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:34:15+00:00 2026-06-01T02:34:15+00:00

I’m looking to implement a REST client in PHP, and have previously been using

  • 0

I’m looking to implement a REST client in PHP, and have previously been using a modified version of the CakePHP Webservice Behavior, which is pretty close to what I am looking for, but I’m not building on Cake, so that’s off the list.

I’m looking for a REST client that allows me to make basic REST requests and get back the headers/body of the request. Optional, but desired features:

  • HTTP Basic Authentication
  • Following redirects
  • Backing off and re-requesting of failed requests

I’ve read through other SO threads and have found a bunch of unhelpful answers that mainly consist of “just write it yourself, it’s not hard” or “use cURL” (i.e. same as the previous one) or “here’s a code snippet that’ll do it” (certainly not established or robust). This question is the most potentially helpful, but it has the above, plus two self-rolled libraries posted by their authors that are very basic and are missing some of the above features and, while they’d probably do the trick, are hardly as established or maintained as I would like.

That question also links to Guzzle, which has the opposite problem – while robust and well-supported, it appears to be hugely complex, difficult to configure and set up, and way more than I’m looking for.

So: does anyone know of an established REST client for PHP that just does REST requests, is small and focused (I’m thinking one, maybe two PHP files), but is widely used and supported? I’m not looking for a framework or a revolution in HTTP usage – just a library to do basic REST requests. I don’t want to reinvent the wheel again, and with the thousands (if not millions) of PHP projects that use REST every day, I’m surprised I haven’t found something like this.

There are plenty of quality REST server libraries available – why not REST clients? I’m basically looking for something like Tonic, but as a client. Pest (from above) looks well-built, and is closest, but I’m just surprised there isn’t something more established.

  • 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-01T02:34:16+00:00Added an answer on June 1, 2026 at 2:34 am

    There are a lot of advanced features in Guzzle, but I still think you can easily use it for your minimal requirements.

    1. Download the phar file that includes all of the classes you’ll need from their GitHub release page: https://github.com/guzzle/guzzle/releases
    2. Include the phar file in your application (this will configure an autoloader for Guzzle)
    3. Create a client
    4. Attach an ExponentialBackoffPlugin to the client
    5. Send requests from the client

    Example:

    <?php
    
    // Include the phar and register the autoloader
    require 'guzzle.phar';
    
    // Create a client for http://test.com (binding to a host is optional)
    $client = new Guzzle\Http\Client('http://test.com');
    
    // Attach the exponential backoff plugin to the client so that requests 
    // are retried automatically
    $client->addSubscriber(Guzzle\Plugin\Backoff\BackoffPlugin::getExponentialBackoff());
    
    // Create and send a GET request to grab the response
    $response = $client->get('/foo.json')->send();
    
    // Dump the JSON response data as an array
    var_dump($response->json());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have thousands of HTML files to process using Groovy/Java and I need to
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.