microsoft/kiota-http-guzzle
Guzzle-based HTTP library for Kiota-generated PHP SDKs. Provides the runtime HTTP adapter used by Kiota clients to send requests to API endpoints. Install via Composer: microsoft/kiota-http-guzzle.
guzzlehttp/guzzle). No major conflicts expected.KiotaHttpClient into controllers/services.UrlReplaceHandler, HeadersInspectionHandler). Misconfiguration could lead to unexpected request/response transformations.ApiException classes, which may require adaptation to Laravel’s exception handling (e.g., Handler middleware).HttpClient or Guzzle instance?ApiException integrate with Laravel’s App\Exceptions\Handler?Illuminate\Support\Facades\Http or guzzlehttp/guzzle), this package fits seamlessly into the existing stack.KiotaHttpClient can be registered as a Laravel service provider, allowing dependency injection.microsoft/kiota-http-guzzle.UrlReplaceHandler, HeadersInspectionHandler) are valuable for custom HTTP logic.// app/Providers/KiotaServiceProvider.php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Microsoft\Kiota\Http\KiotaHttpClient;
use GuzzleHttp\Client;
class KiotaServiceProvider extends ServiceProvider
{
public function register()
{
$this->app->singleton(KiotaHttpClient::class, function ($app) {
$guzzleClient = new Client();
return new KiotaHttpClient($guzzleClient);
});
}
}
// app/Facades/Kiota.php
namespace App\Facades;
use Illuminate\Support\Facades\Facade;
class Kiota extends Facade
{
protected static function getFacadeAccessor() { return 'kiota.http'; }
}
$response = Http::withOptions([
'handler' => KiotaHttpClient::getHandlerStack($guzzleClient),
])->get('https://api.example.com');
microsoft/kiota-abstractions-php (~1.0). Ensure no version conflicts.KiotaHttpClient in Laravel’s container.App\Exceptions\Handler to process ApiException.UrlReplaceHandler) may need tuning for Laravel-specific use cases.ApiException may require custom exception mapping in Laravel’s render() method.tap() or DD() to inspect requests/responses in middleware.RequestInformation, ResponseInformation).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| PHP 8.2+ Required (v2.0+) | App crashes if PHP version < 8.2 | Upgrade PHP or use v1.x |
| Kiota Middleware Misconfiguration | Malformed requests/responses | Test with tap() and validate middleware order |
| Guzzle Version Conflict | HTTP calls fail silently | Pin Guzzle version in composer.json |
| Custom Error Handling Needed | ApiException not caught properly |
Extend App\Exceptions\Handler |
| OTEL Tracing Overhead | Increased latency in observability | Disable if not needed |
RequestInformation).How can I help you explore Laravel packages today?