Class yii\httpclient\Client
| Inheritance | yii\httpclient\Client » yii\base\Component » yii\base\BaseObject |
|---|---|
| Implements | yii\base\Configurable |
| Available since version | 2.0 |
| Source Code | https://github.com/yiisoft/yii2-httpclient/blob/master/Client.php |
Client provide high level interface for HTTP requests execution.
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $baseUrl | string | Base request URL. | yii\httpclient\Client |
| $behaviors | yii\base\Behavior[] | List of behaviors attached to this component | yii\base\Component |
| $contentLoggingMaxSize | integer | Maximum symbols count of the request content, which should be taken to compose a log and profile messages. | yii\httpclient\Client |
| $formatters | array | The formatters for converting data into the content of the specified \yii\httpclient\format. | yii\httpclient\Client |
| $parsers | array | The parsers for converting content of the specified \yii\httpclient\format into the data. | yii\httpclient\Client |
| $requestConfig | array | Request object configuration. | yii\httpclient\Client |
| $responseConfig | array | Response config configuration. | yii\httpclient\Client |
| $transport | yii\httpclient\Transport|array|string | HTTP message transport | yii\httpclient\Client |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __call() | Calls the named method which is not a class method. | yii\base\Component |
| __clone() | This method is called after the object is created by cloning an existing one. | yii\base\Component |
| __construct() | Constructor. | yii\base\BaseObject |
| __get() | Returns the value of a component property. | yii\base\Component |
| __isset() | Checks if a property is set, i.e. defined and not null. | yii\base\Component |
| __set() | Sets the value of a component property. | yii\base\Component |
| __unset() | Sets a component property to be null. | yii\base\Component |
| afterSend() | This method is invoked right after request is sent. | yii\httpclient\Client |
| attachBehavior() | Attaches a behavior to this component. | yii\base\Component |
| attachBehaviors() | Attaches a list of behaviors to the component. | yii\base\Component |
| batchSend() | Performs multiple HTTP requests in parallel. | yii\httpclient\Client |
| beforeSend() | This method is invoked right before request is sent. | yii\httpclient\Client |
| behaviors() | Returns a list of behaviors that this component should behave as. | yii\base\Component |
| canGetProperty() | Returns a value indicating whether a property can be read. | yii\base\Component |
| canSetProperty() | Returns a value indicating whether a property can be set. | yii\base\Component |
| className() | Returns the fully qualified name of this class. | yii\base\BaseObject |
| createRequest() | yii\httpclient\Client | |
| createRequestLogToken() | Composes the log/profiling message token for the given HTTP request parameters. | yii\httpclient\Client |
| createResponse() | Creates a response instance. | yii\httpclient\Client |
| delete() | Creates 'DELETE' request. | yii\httpclient\Client |
| detachBehavior() | Detaches a behavior from the component. | yii\base\Component |
| detachBehaviors() | Detaches all behaviors from the component. | yii\base\Component |
| ensureBehaviors() | Makes sure that the behaviors declared in behaviors() are attached to this component. | yii\base\Component |
| get() | Creates 'GET' request. | yii\httpclient\Client |
| getBehavior() | Returns the named behavior object. | yii\base\Component |
| getBehaviors() | Returns all behaviors attached to this component. | yii\base\Component |
| getFormatter() | Returns HTTP message formatter instance for the specified format. | yii\httpclient\Client |
| getParser() | Returns HTTP message parser instance for the specified format. | yii\httpclient\Client |
| getTransport() | yii\httpclient\Client | |
| hasEventHandlers() | Returns a value indicating whether there is any handler attached to the named event. | yii\base\Component |
| hasMethod() | Returns a value indicating whether a method is defined. | yii\base\Component |
| hasProperty() | Returns a value indicating whether a property is defined for this component. | yii\base\Component |
| head() | Creates 'HEAD' request. | yii\httpclient\Client |
| init() | Initializes the object. | yii\base\BaseObject |
| off() | Detaches an existing event handler from this component. | yii\base\Component |
| on() | Attaches an event handler to an event. | yii\base\Component |
| options() | Creates 'OPTIONS' request. | yii\httpclient\Client |
| patch() | Creates 'PATCH' request. | yii\httpclient\Client |
| post() | Creates 'POST' request. | yii\httpclient\Client |
| put() | Creates 'PUT' request. | yii\httpclient\Client |
| send() | Performs given request. | yii\httpclient\Client |
| setTransport() | Sets the HTTP message transport. It can be specified in one of the following forms: | yii\httpclient\Client |
| trigger() | Triggers an event. | yii\base\Component |
Protected Methods
| Method | Description | Defined By |
|---|---|---|
| createRequestShortcut() | yii\httpclient\Client |
Events
| Event | Type | Description | Defined By |
|---|---|---|---|
| EVENT_AFTER_SEND | yii\httpclient\RequestEvent | An event raised right after request has been sent. | yii\httpclient\Client |
| EVENT_BEFORE_SEND | yii\httpclient\RequestEvent | An event raised right before sending request. | yii\httpclient\Client |
Constants
| Constant | Value | Description | Defined By |
|---|---|---|---|
| FORMAT_CURL | 'curl' | CURL format | yii\httpclient\Client |
| FORMAT_JSON | 'json' | JSON format | yii\httpclient\Client |
| FORMAT_RAW_URLENCODED | 'raw-urlencoded' | Urlencoded by PHP_QUERY_RFC3986 query string, like name1=value1&name2=value2 | yii\httpclient\Client |
| FORMAT_URLENCODED | 'urlencoded' | Urlencoded by RFC1738 query string, like name1=value1&name2=value2 | yii\httpclient\Client |
| FORMAT_XML | 'xml' | XML format | yii\httpclient\Client |
Property Details
Base request URL.
Maximum symbols count of the request content, which should be taken to compose a log and profile messages. Exceeding content will be truncated.
See also createRequestLogToken().
The formatters for converting data into the content of the specified \yii\httpclient\format. The array keys are the format names, and the array values are the corresponding configurations for creating the formatter objects.
The parsers for converting content of the specified \yii\httpclient\format into the data. The array keys are the format names, and the array values are the corresponding configurations for creating the parser objects.
Request object configuration.
Response config configuration.
HTTP message transport
Method Details
This method is invoked right after request is sent.
The method will trigger the EVENT_AFTER_SEND event.
| public void afterSend ( $request, $response ) | ||
| $request | yii\httpclient\Request | Request instance. |
| $response | yii\httpclient\Response | Received response instance. |
Performs multiple HTTP requests in parallel.
This method accepts an array of the yii\httpclient\Request objects and returns an array of the yii\httpclient\Response objects. Keys of the response array correspond the ones from request array.
$client = new Client();
$requests = [
'news' => $client->get('http://domain.com/news'),
'friends' => $client->get('http://domain.com/user/friends', ['userId' => 12]),
];
$responses = $client->batchSend($requests);
var_dump($responses['news']->isOk);
var_dump($responses['friends']->isOk);
| public yii\httpclient\Response[] batchSend ( array $requests ) | ||
| $requests | yii\httpclient\Request[] | Requests to perform. |
| return | yii\httpclient\Response[] | Responses list. |
|---|---|---|
| throws | yii\httpclient\Exception | |
| throws | yii\base\InvalidConfigException |
This method is invoked right before request is sent.
The method will trigger the EVENT_BEFORE_SEND event.
| public void beforeSend ( $request ) | ||
| $request | yii\httpclient\Request | Request instance. |
| public yii\httpclient\Request createRequest ( ) | ||
| return | yii\httpclient\Request | Request instance. |
|---|---|---|
| throws | yii\base\InvalidConfigException |
Composes the log/profiling message token for the given HTTP request parameters.
This method should be used by transports during request sending logging.
| public string createRequestLogToken ( $method, $url, $headers, $content ) | ||
| $method | string | Request method name. |
| $url | string | Request URL. |
| $headers | array | Request headers. |
| $content | string | Request content. |
| return | string | Log token. |
|---|
| protected yii\httpclient\Request createRequestShortcut ( $method, $url, $data, $headers, $options ) | ||
| $method | string | |
| $url | array|string | |
| $data | array|string | |
| $headers | array | |
| $options | array | |
| return | yii\httpclient\Request | Request instance. |
|---|---|---|
| throws | yii\base\InvalidConfigException |
Creates a response instance.
| public yii\httpclient\Response createResponse ( $content = null, array $headers = [] ) | ||
| $content | string | Raw content |
| $headers | array | Headers list. |
| return | yii\httpclient\Response | Request instance. |
|---|---|---|
| throws | yii\base\InvalidConfigException |
Creates 'DELETE' request.
| public yii\httpclient\Request delete ( $url, $data = null, $headers = [], $options = [] ) | ||
| $url | array|string | Target URL. |
| $data | array|string | If array - request data, otherwise - request content. |
| $headers | array | Request headers. |
| $options | array | Request options. |
| return | yii\httpclient\Request | Request instance. |
|---|
Creates 'GET' request.
| public yii\httpclient\Request get ( $url, $data = null, $headers = [], $options = [] ) | ||
| $url | array|string | Target URL. |
| $data | array|string | If array - request data, otherwise - request content. |
| $headers | array | Request headers. |
| $options | array | Request options. |
| return | yii\httpclient\Request | Request instance. |
|---|
Returns HTTP message formatter instance for the specified format.
| public yii\httpclient\FormatterInterface getFormatter ( $format ) | ||
| $format | string | Format name. |
| return | yii\httpclient\FormatterInterface | Formatter instance. |
|---|---|---|
| throws | yii\base\InvalidParamException | on invalid format name. |
| throws | yii\base\InvalidConfigException |
Returns HTTP message parser instance for the specified format.
| public yii\httpclient\ParserInterface getParser ( $format ) | ||
| $format | string | Format name |
| return | yii\httpclient\ParserInterface | Parser instance. |
|---|---|---|
| throws | yii\base\InvalidParamException | on invalid format name. |
| throws | yii\base\InvalidConfigException |
| public yii\httpclient\Transport getTransport ( ) | ||
| return | yii\httpclient\Transport | HTTP message transport instance. |
|---|---|---|
| throws | yii\base\InvalidConfigException |
Creates 'HEAD' request.
| public yii\httpclient\Request head ( $url, $headers = [], $options = [] ) | ||
| $url | array|string | Target URL. |
| $headers | array | Request headers. |
| $options | array | Request options. |
| return | yii\httpclient\Request | Request instance. |
|---|
Creates 'OPTIONS' request.
| public yii\httpclient\Request options ( $url, $options = [] ) | ||
| $url | array|string | Target URL. |
| $options | array | Request options. |
| return | yii\httpclient\Request | Request instance. |
|---|
Creates 'PATCH' request.
| public yii\httpclient\Request patch ( $url, $data = null, $headers = [], $options = [] ) | ||
| $url | array|string | Target URL. |
| $data | array|string | If array - request data, otherwise - request content. |
| $headers | array | Request headers. |
| $options | array | Request options. |
| return | yii\httpclient\Request | Request instance. |
|---|
Creates 'POST' request.
| public yii\httpclient\Request post ( $url, $data = null, $headers = [], $options = [] ) | ||
| $url | array|string | Target URL. |
| $data | array|string | If array - request data, otherwise - request content. |
| $headers | array | Request headers. |
| $options | array | Request options. |
| return | yii\httpclient\Request | Request instance. |
|---|
Creates 'PUT' request.
| public yii\httpclient\Request put ( $url, $data = null, $headers = [], $options = [] ) | ||
| $url | array|string | Target URL. |
| $data | array|string | If array - request data, otherwise - request content. |
| $headers | array | Request headers. |
| $options | array | Request options. |
| return | yii\httpclient\Request | Request instance. |
|---|
Performs given request.
| public yii\httpclient\Response send ( $request ) | ||
| $request | yii\httpclient\Request | Request to be sent. |
| return | yii\httpclient\Response | Response instance. |
|---|---|---|
| throws | yii\httpclient\Exception | on failure. |
| throws | yii\base\InvalidConfigException |
Sets the HTTP message transport. It can be specified in one of the following forms:
- an instance of
Transport
: actual transport object to be used - a string: representing the class name of the object to be created
- a configuration array: the array must contain a
class
element which is treated as the object class, and the rest of the name-value pairs will be used to initialize the corresponding object properties - a PHP callable: either an anonymous function or an array representing a class method (
[$class or $object, $method]
). The callable should return a new instance of the object being created.
| public void setTransport ( $transport ) | ||
| $transport | yii\httpclient\Transport|array|string | HTTP message transport |
Event Details
An event raised right after request has been sent.
An event raised right before sending request.


Package org.revapi
Interface ArchiveAnalyzer<E extends Element<E>>
-
- All Known Implementing Classes:
BaseArchiveAnalyzer
,BaseEagerLoadingArchiveAnalyzer
,ZipArchiveAnalyzer
public interface ArchiveAnalyzer<E extends Element<E>>
The instances of implementations of this interface are produced by theApiAnalyzer
s to analyze the API archives and create an element tree that is then used for API comparison.- Since:
- 0.1
- Author:
- Lukas Krejci
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ElementForest<E>
analyze(TreeFilter<E> filter)
Analyzes the API archives and filters the forest using the provided filter.API
getApi()
ApiAnalyzer<E>
getApiAnalyzer()
void
prune(ElementForest<E> forest)
Once all the filtering on the element forest is done, the analyzer is allowed one final "pass" through the forest to remove any elements that should not be there any longer.
-
-
-
Method Detail
-
getApiAnalyzer
ApiAnalyzer<E> getApiAnalyzer()
- Returns:
- the
ApiAnalyzer
that created this instance
-
getApi
API getApi()
- Returns:
- the API that this analyzer analyzes
-
analyze
ElementForest<E> analyze(TreeFilter<E> filter)
Analyzes the API archives and filters the forest using the provided filter.This produces a preliminary forest which can be too "wide" because of
Ternary.UNDECIDED
elements or non-local relationships between elements. Once this method returns the preliminary forest, the callers should also call theprune(ElementForest)
method to obtain a forest that is truly minimal.- Parameters:
filter
- the filter to use to filter out unwanted elements from the forest- Returns:
- the preliminary element forest that should be
pruned
before analysis
-
prune
void prune(ElementForest<E> forest)
Once all the filtering on the element forest is done, the analyzer is allowed one final "pass" through the forest to remove any elements that should not be there any longer.- Parameters:
forest
- the forest to prune
-
-


Features
Comprehensively Tested
Tribe has a comprehensive suite of hundreds of unit and integration tests.
You can see the JavaScript tests online for
Tribe and PackScript.
More C# unit and integration tests are available in the source.
Composite
- Built on the power of knockout - declarative data binding, observables and more.
- Break your UI down into reusable pieces in a way that makes sense to you.
- Simply and easily model navigation flow and business processes.
- Smooth, hardware accelerated transitions - a core part of Tribe.Composite.
- Full resource lifecycle management - Tribe manages the lifecycle of panes from load through to disposal.
- Simple and intuitive - structure your project how you need without complex configuration.
MessageBus
- Built on reliable, highly scalable, proven technology (Microsoft SignalR).
- Transparently broadcast messages to other users on both web and mobile devices.
- Seamlessly translate messages into server side messaging technology, like NServiceBus or Azure queues.
- Built in record and replay semantics - event sourcing out of the box.
- Secure channels with simple and extensible authorisation.
Mobile
- Target mobile devices with the same codebase as your web application.
- Easily customisable pre-built themes and UI components - focus on building your app.
PackScript
- Powerful resource building system for combining and minifying resources.
- Combine, minify, transform, template, compile and more.
- Simple JavaScript configuration API.
- "Watch" mode to update your build every time you save a file.
- Easily integrates with continuous integration tools.
Forms
- Simple, themable set of templates for creating forms.
- Model-based validation without any additional markup.
Components
- A basic set of reusable user interface components including:
- Grid
- Graph
- Dialog
- Expander
- Tab panel
- Tooltip
- Google Map


{% extends "global/Page.html" %} {% load staticfiles otree %} {% block scripts %} {% endblock %} {% block title %} Decision {{ round_num }} - {{ mode }} with {{ rebate }}% rebate {% endblock %} {% block content %}
Out of the ${{ Constants.endowment }} you are endowed with for this period, would you like to donate any to the charity of your choice? {% if rebate != 0 %} While you are donating, the UCSC LEEPS lab would like to offer you a rebate of {{ rebate }}% of your donation. {% else %} You will not receive any rebates of your donation. {% endif %}
{% if mode == 'Public' %}If your decision in this period is chosen for payment AND:
If your decision in this period is chosen for payment AND:


Meros
Main
Send
Quit
If you don't have a Mnemonic, leave the field blank to create one.
Mnemonic:
Set Mnemonic


{% extends "wcoa/mapgroups/base.html" %} {% load static %} {% block extra_css %} {{ block.super }} {% endblock %} {% block page_header %} ← {{ mapgroup.name }} {% endblock %} {% block content %}
Tip: Anyone can join a public group. Group owners approve private group membership requests.
Deleting a group is permanent, and cannot be undone. Delete group
Deleting a group is permanent, and cannot be undone.
Delete group


{% extends "base.html" %} {% block header %} {% endblock %} {% block content %}
Guests
This months pot is {{ pot }}
{% if user.is_authenticated %} {% for member in top10 %}
Free To Join
Free To Play
And it could be yours
If you stay
Members