Kong/unirest-php is tracked by TopGit as an open-source project, with 1.3k stars on GitHub, written primarily in PHP. Unirest in PHP: Simplified, lightweight HTTP client library.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Note: we did not use the Unirest\Request\Body::multipart helper in this example, it is not needed when manually adding files.
Custom Body
Sending a custom body such rather than using the Unirest\Request\Body helpers is also possible, for example, using a serialize body string with a custom Content-Type:
The third parameter, which is a bitmask, will Unirest which HTTP authentication method(s) you want it to use for your proxy authentication.
If more than one bit is set, Unirest (at PHP's libcurl level) will first query the site to see what authentication methods it supports and then pick the best one you allow it to use. For some methods, this will induce an extra network round-trip.
Supported Methods
Method
Description
CURLAUTH_BASIC
HTTP Basic authentication. This is the default choice
CURLAUTH_DIGEST
HTTP Digest authentication. as defined in RFC 2617
CURLAUTH_DIGEST_IE
HTTP Digest authentication with an IE flavor. The IE flavor is simply that libcurl will use a special "quirk" that IE is known to have used before version 7 and that some servers require the client to use.
CURLAUTH_NEGOTIATE
HTTP Negotiate (SPNEGO) authentication. as defined in RFC 4559
CURLAUTH_NTLM
HTTP NTLM authentication. A proprietary protocol invented and used by Microsoft.
CURLAUTH_NTLM_WB
NTLM delegating to winbind helper. Authentication is performed by a separate binary application. see libcurl docs for more info
CURLAUTH_ANY
This is a convenience macro that sets all bits and thus makes libcurl pick any it finds suitable. libcurl will automatically select the one it finds most secure.
CURLAUTH_ANYSAFE
This is a convenience macro that sets all bits except Basic and thus makes libcurl pick any it finds suitable. libcurl will automatically select the one it finds most secure.
CURLAUTH_ONLY
This is a meta symbol. OR this value together with a single specific auth value to force libcurl to probe for un-restricted auth and if not, only that single auth algorithm is acceptable.
This has been deprecated, and will be completely removed in v.3.0.0 please use the Unirest\Request::auth() method instead
Cookies
Set a cookie string to specify the contents of a cookie header. Multiple cookies are separated with a semicolon followed by a space (e.g., "fruit=apple; colour=red")
Unirest\Request::cookie($cookie)
Set a cookie file path for enabling cookie reading and storing cookies across multiple sequence of requests.
Unirest\Request::cookieFile($cookieFile)
$cookieFile must be a correct path with write permission.
Upon recieving a response Unirest returns the result in the form of an Object, this object should always have the same keys for each language regarding to the response details.
code - HTTP Response Status Code (Example 200)
headers - HTTP Response Headers
body - Parsed response body where applicable, for example JSON responses are parsed to Objects / Associative Arrays.
raw_body - Un-parsed response body
Advanced Configuration
You can set some advanced configuration to tune Unirest-PHP:
Custom JSON Decode Flags
Unirest uses PHP's JSON Extension for automatically decoding JSON responses.
sometime you may want to return associative arrays, limit the depth of recursion, or use any of the customization flags.
To do so, simply set the desired options using the jsonOpts request method:
you can also set the proxy type to be one of CURLPROXY_HTTP, CURLPROXY_HTTP_1_0, CURLPROXY_SOCKS4, CURLPROXY_SOCKS5, CURLPROXY_SOCKS4A, and CURLPROXY_SOCKS5_HOSTNAME.
check the cURL docs for more info.
// quick setup with default port: 1080
Unirest\Request::proxy('10.10.10.1');
// custom port and proxy type
Unirest\Request::proxy('10.10.10.1', 8080, CURLPROXY_HTTP);
// enable tunneling
Unirest\Request::proxy('10.10.10.1', 8080, CURLPROXY_HTTP, true);
Proxy Authenticaton
Passing a username, password (optional), defaults to Basic Authentication:
The third parameter, which is a bitmask, will Unirest which HTTP authentication method(s) you want it to use for your proxy authentication.
If more than one bit is set, Unirest (at PHP's libcurl level) will first query the site to see what authentication methods it supports and then pick the best one you allow it to use. For some methods, this will induce an extra network round-trip.
See Authentication for more details on methods supported.
The most recent commit recorded on Kong/unirest-php was 1.5 years ago, based on the GitHub push timestamp. The repository has 316 forks — one of the better signals of community interest.
How many stars does Kong/unirest-php have?
Kong/unirest-php has 1.3k GitHub stars — refresh the page for the live number, or check github.com/Kong/unirest-php. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is Kong/unirest-php open source?
Yes — Kong/unirest-php ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/Kong/unirest-php.
What is Kong/unirest-php?
Kong/unirest-php (Kong/unirest-php) is a PHP project on GitHub. From the project's own README: Unirest in PHP: Simplified, lightweight HTTP client library.
What language is Kong/unirest-php written in?
Kong/unirest-php is written primarily in PHP. GitHub's language field is based on the largest share of bytes in the default branch.
What license does Kong/unirest-php use?
Kong/unirest-php is released under the MIT license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where do I read more about Kong/unirest-php?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/Kong/unirest-php is the definitive source.
Read full README in the tab above.
Want a second opinion on unirest-php?
Ask an AI that can read this page — one click and you get its take on unirest-php.