Kong/unirest-php là dự án PHP với 1.3k sao. Unirest in PHP: Simplified, lightweight HTTP client library.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/Kong/unirest-php là nguồn chính thức.
Kong/unirest-php có bao nhiêu sao?
Kong/unirest-php có 1.3k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/Kong/unirest-php. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
Kong/unirest-php có phải mã nguồn mở không?
Có — Kong/unirest-php phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/Kong/unirest-php.
Kong/unirest-php còn đang phát triển không?
Commit gần nhất trên Kong/unirest-php là 1.5 năm trước (theo timestamp GitHub). Repo có 316 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Kong/unirest-php dùng license gì?
Kong/unirest-php phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
Kong/unirest-php là gì?
Kong/unirest-php (Kong/unirest-php) là dự án PHP trên GitHub. Theo mô tả gốc: Unirest in PHP: Simplified, lightweight HTTP client library.
Kong/unirest-php viết bằng ngôn ngữ gì?
Kong/unirest-php chủ yếu viết bằng PHP. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc unirest-php có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về unirest-php.