Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127772 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 54B621A00BC for ; Fri, 27 Jun 2025 14:37:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1751034956; bh=vKNINDtjefbixrfwiGN+eBdo3YNel4CrQ05mzkAZjj0=; h=Date:From:To:In-Reply-To:References:Subject:From; b=lzxXRq39h2BLqorXHmrcl8B2X9Yb4oQnMU2wF+J8V291HA/UJCNmD3R8tRHkv1OBH uqWSciMQvftRnQ2k789YqGN10hjr9b17UBZRSuokJkF5Bn/1NxPvjKxTKB/JzHPItz VMtKqRviX0ZduKE2m7iBWi0hNLtfB54PBD9PTDDAq/AWJpJs5es0fUz5brsrSC0mjP s19xCeqbrcjhmV2FpNC/dJM530ybh7kuo3+VDkvBFJgQ5iolR3JOt/tHW5JzNuMlEa 7zhIVO+JDXjMEJrewyp/LJtRrlMOWN79sfknbwBN2bvNB3mlt9HT4mkDP+9qFl/Kze J8kMdLFso5ymQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C554F180074 for ; Fri, 27 Jun 2025 14:35:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fout-b5-smtp.messagingengine.com (fout-b5-smtp.messagingengine.com [202.12.124.148]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 27 Jun 2025 14:35:55 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.stl.internal (Postfix) with ESMTP id A72C21D0017A for ; Fri, 27 Jun 2025 10:37:49 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-10.internal (MEProxy); Fri, 27 Jun 2025 10:37:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm2; t=1751035069; x=1751121469; bh=juoAZR8y93FoHE7mGO/2I G7OsU8lSLQJRD5MDmIhQqo=; b=o5OOuO79vxZdLHmr/hYo4V7iePA7MQHgGkOhI Ta7qjIIa90EQjv6IvrzKtnaptLDvv6A//cwPA6MdmLkIakKgD9mC229vkMduMAdq IasSlOOIFZd3pXILBp3medXPHN3K+IW3vFeYuMqKsC2+a1UO8VJ1TomGQ3+48+sH UrskS4q3YSN/gBNfYoxlO6EulFNQOw056AYpgpgMcCgD4iJ8m4qGh2RXRRGXTYHB bjq/1RSk6YGIq+ex/a3RIwSlm6P7r6h2VOMwW8lLiThpay2bcD7ouFPzKb/XxhS8 XE0xoOaobge37Ta1WQzrvRb7CZT84u1atKWx0DAXhicR7r52g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1751035069; x=1751121469; bh=j uoAZR8y93FoHE7mGO/2IG7OsU8lSLQJRD5MDmIhQqo=; b=N4wC2+LQb38sKj5Mu NRzRT7wQjFEUR/iy4x60GJibGj6QOI27P22qo8ObM06WhjBvmNCp8xOhSz6dNq77 DPOOLmJkiGv3AcoGA4C3+wtWctDhnzlpD9wt8XwH50Qgu9WqrnoEQisU7UfuVk0w 56BIRaIQj89nQiGLetpYNjFGPlciBBtk0ZY3TNuh+fCt8QvP1/S7dyIQQTejwtp6 4f5F3Lh/Qt1P1TUfEhVeGoe0F4LcAIDR0eTZo73MztO3KJSfGeadAjoG2f3emfPm wATkbP/WUYvZljE+EqKvK6bHCkVNXU1X2DWUk/BggZATc5D5Ph7tqa6iqH58T1eu GImmA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdeffedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh epofggfffhvffkjghfufgtgfesthejredtredttdenucfhrhhomhepfdfnrghrrhihucfi rghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmqeenuc ggtffrrghtthgvrhhnpeehuedtfedttdffteegvddvkeejgfeuveethfffvedvtddvieef tddutefhuddvkeenucffohhmrghinhepvgigrghmphhlvgdrtghomhenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhi vghlughtvggthhdrtghomhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouh htpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id E015D700063; Fri, 27 Jun 2025 10:37:48 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: T6541924c602fb011 Date: Fri, 27 Jun 2025 09:37:28 -0500 To: "php internals" Message-ID: In-Reply-To: References: <22a4327d-b27d-4e24-b07a-ae380fe8a0c4@app.fastmail.com> Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2 Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Thu, Jun 26, 2025, at 10:51 PM, Eric Norris wrote: >> Adding more helpers in later versions is entirely trivial, but we could >> set the precedent with a first batch on day one. > > I'm not opposed to this, but I am - as previously stated - nervous > about how and where we draw this line, since I expect there may be a > lot of opinions here. That said, if the general consensus is that we > want direct methods or properties for the N most common use-cases, I'm > happy to make that change to the RFC. > > I can try to take a look at the curl options and do some github > searches to see if I can identify common patterns. I agree that > setting the HTTP method and timeout are good contenders. If someone > else wants to propose a list as well, feel free! My gut sense is that the following use cases would cover the 80% case: GET http://www.example.com/foo?bar=baz (Send a GET request with a complex URL. Probably needs both transparent redirecting and not options.) POST http://www.example.com/foo with a JSON body (This means setting a body string/array, and a content-type header.) POST http://www.example.com/foo with a multipart/form-data body (This means making it easy to set the body, and corresponding content-type header.) And those should also allow setting an Accept header. Which means probably any header should be easy to set, with maybe one or two extra-promoted ones. (Like, when setting the body you can also set the content type?) I don't know if specifying an HTTP version is relevant/useful. I have never done so myself, but that proves little. On the return side, I almost always check the status code, at least. That's probably the only non-body thing I check. :-) So making that trivial is also important. Whether that's via a mini-response object instead of a string or something else is open for discussion, I think. Other questions: * We have these shiny new URL/URI objects. Should those be supported directly? --Larry Garfield