[TYPO3-dev] Equivalent to t3lib_div::getURL() for posting too?

Martin Kutschker masi-no at spam-typo3.org
Mon Aug 25 10:19:47 CEST 2008


Francois Suter schrieb:
> Hi Masi,
> 
>> So what exactly do you want to do? Send POST data to a script? I think a
>> general "upload" function is not so easily done as a "download"
>> function .
> 
> Basically I'm calling a TYPO3 server from another TYPO3 server and
> performing a BE login, plus passing some additional query parameters,
> and expecting some data in return. By default TYPO3 requires the login
> data to be passed as POST (I know this can be changed, but it's less
> secure and I would rather avoid that).
> 
> I would like to do this cleanly like t3lib_div::getURL(), which is
> capable of handling the use of curl or not. From your answer, I guess
> that no such function already exists. I'll try to make one then.

I'd simply use CURL for that. Of course you could write your own HTTP
client, but why bother? While standard cases are quite easy to handle
the HTTP protocol allows for some interesting things (like chunked
responses), so you'll probably handle only basic stuff.

Masi

PS:  t3lib_div::getURL() has (at least) 2 shortcomings: no redirects, no
chunked responses. Besides that proxies and authentication are also only
supported via CURL.




More information about the TYPO3-dev mailing list