Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Zend Http Laravel Package

zendframework/zend-http

Zend\Http is a PHP HTTP component for building and processing HTTP messages. It provides clients and adapters for making requests, plus request/response objects, headers, cookies, and utilities to work with URIs and HTTP-level features in your apps.

View on GitHub
Deep Wiki
Context7

HTTP Client - Static Usage

zend-http provides another client implementation, Zend\Http\ClientStatic, a static HTTP client which exposes a simplified API for quickly performing one-off GET and POST operations.

Quick Start

use Zend\Http\ClientStatic;

// Simple GET request
$response = ClientStatic::get('http://example.org');

// More complex GET request, specifying query string 'foo=bar' and adding a
// custom header to request JSON data be returned (Accept: application/json):
$response = ClientStatic::get(
    'http://example.org',
    ['foo' => 'bar'],
    ['Accept' => 'application/json']
);

// We can also do a POST request using the same format. Here we POST
// login credentials (username/password) to a login page:
$response = ClientStatic::post(
    'https://example.org/login.php',
    [
        'username' => 'foo',
        'password' => 'bar',
    ]
);

Available Methods

get()

get(
    string $url,
    array $query = [],
    array $headers = [],
    mixed $body = null,
    $clientOptions = null
) : Response

Perform an HTTP GET request using the provided URL, query string variables, headers, and request body. The fifth parameter can be used to pass configuration options to the HTTP client instance.

post()

post(
    string $url,
    array $params,
    array $headers = [],
    mixed $body = null,
    $clientOptions = null
) : Response

Perform an HTTP POST request using the provided URL, parameters, headers, and request body. The fifth parameter can be used to pass configuration options to the HTTP client instance.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport