Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update http-client.md #412

Open
wants to merge 1 commit into
base: 11.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions http-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,10 @@ $response = Http::withHeaders([
По умолчанию сообщения `RequestException` усекаются до 120 символов при логировании или в сообщении об ошибке. Чтобы настроить или отключить это поведение, вы можете использовать методы `truncateRequestExceptionsAt` и `dontTruncateRequestExceptions` при настройке поведения обработки исключений вашего приложения в файле `bootstrap/app.php`:

->withExceptions(function (Exceptions $exceptions) {
// Truncate request exception messages to 240 characters...
// Усекаем сообщения об исключениях запроса до 240 символов...
$exceptions->truncateRequestExceptionsAt(240);

// Disable request exception message truncation...
// Отключаем усечение сообщения об исключении запроса...
$exceptions->dontTruncateRequestExceptions();
})

Expand Down Expand Up @@ -397,7 +397,7 @@ Http::globalResponseMiddleware(fn ($response) => $response->withHeader(
use Illuminate\Support\Facades\Http;

/**
* Bootstrap any application services.
* Загрузка любых сервисов приложения.
*/
public function boot(): void
{
Expand Down Expand Up @@ -441,7 +441,7 @@ public function boot(): void
return $responses['first']->ok();

<a name="customizing-concurrent-requests"></a>
#### Customizing Concurrent Requests
#### Настройка параллельных запросов

Метод `pool` не может быть объединен с другими методами HTTP-клиента, такими как `withHeaders` или `middleware`. Если вы хотите применить пользовательские заголовки или middleware к пулу запросов, вы должны настроить эти параметры для каждого запроса в пуле:

Expand Down Expand Up @@ -469,7 +469,7 @@ HTTP-клиент Laravel позволяет вам определять «ма
use Illuminate\Support\Facades\Http;

/**
* Bootstrap any application services.
* Загрузка любых сервисов приложения.
*/
public function boot(): void
{
Expand Down Expand Up @@ -596,10 +596,10 @@ $response = Http::github()->get('/');
'github.com/*' => Http::response('ok'),
]);

// An "ok" response is returned...
// Возвращается ответ «ОК»...
Http::get('https://github.com/laravel/framework');

// An exception is thrown...
// Выбрасывается исключение...
Http::get('https://laravel.com');

<a name="inspecting-requests"></a>
Expand Down Expand Up @@ -707,7 +707,7 @@ Laravel запускает три события в процессе отпра
class LogRequest
{
/**
* Handle the given event.
* Обработка данного события.
*/
public function handle(RequestSending $event): void
{
Expand Down