Download the PHP package toohamster/ws-http without Composer

On this page you can find all versions of the php package toohamster/ws-http. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ws-http

ws-http

简单轻量的HTTP 客户端工具库(An Simplified, lightweight HTTP client library)

ws-http

可用于 HTTP API 测试,支持 ssl,basic auth,代理,自定义请求头,以及常用HTTP 请求方法.(An HTTP API testing framework, written in PHP using curl. Supports ssl, basic auth, passing custom request headers, and most HTTP request methods.

需求(Requirements)

安装(Installation)

使用 (Using) Composer

composer.json文件中新增如下行(To install ws-http with Composer, just add the following to your composer.json file):

或者手动运行命令(or by running the following command):

Http Request 使用(Http Request Usage)

创建一个请求(Creating a Request)

``

支持的方法(Support Method)

``

此处给出一些简单的实例(Let's look at a working example):

JSON 请求(Requests) (application/json)

注意(Notes):

表单请求(Form Requests) (application/x-www-form-urlencoded)

注意(Notes):

Multipart Requests (multipart/form-data)

注意(Notes):

文件上传(Multipart File Upload)

自定义消息体(Custom Body)

可以使用Ws\Http\Request\Body类提供的方法来生成消息体或使用PHP自带的序列化函数来生成消息体(Sending a custom body such rather than using the Ws\Http\Request\Body helpers is also possible, for example, using a serialize body string with a custom Content-Type):

授权校验(Authentication)

支持的方法(Supported Methods)

Method Description
CURLAUTH_BASIC HTTP Basic authentication.
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.

Cookies

$cookieFile 参数必须是可读取的文件路径(must be a correct path with write permission).

请求对象(Request Object)

可以使用标准的HTTP方法,也可以使用自定义的HTTP方法(You can send a request with any standard or custom HTTP Method):

响应对象(Response Object)

高级设置(Advanced Configuration)

自定义json_decode选项(Custom JSON Decode Flags)

超时设置(Timeout)

代理(Proxy)

可以设置代理类型(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.

代理授权验证 (Proxy Authenticaton)

缺省请求头 (Default Request Headers)

批量配置(You can set default headers in bulk by passing an array):

清除配置(You can clear the default headers anytime with):

缺省Curl选项 (Default cURL Options)

You can set default cURL options that will be sent on every request:

批量配置(You can set options bulk by passing an array):

清除配置(You can clear the default options anytime with):

SSL validation

By default is true.

Http Watcher 使用(Http Watcher Usage)

支持的方法(Support Method)

``

例子(Examples)

``

``

查看所有例子(See the full examples) https://github.com/toohamster/ws-http/blob/master/tests/Ws/Http/ATest.php.


All versions of ws-http with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package toohamster/ws-http contains the following files

Loading the files please wait ....