I
I
imextra2014-02-25 09:31:07
PHP
imextra, 2014-02-25 09:31:07

Which is faster and better - cUrl or Socket for POST requests in php?

Hello!
Actually there is a server which scripts interact through API.

In the page code, a request is formed (single) and the data is sent by a POST request (text).
Now implemented on cUrl (library - https://github.com/dongsheng/cURL/blob/master/curl... The

question is, which is faster and better to use cURL or Socket?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Max, 2014-02-25
@AloneCoder

Works? Don't touch
it, but the socket might give some gain.

O
OnYourLips, 2014-02-25
@OnYourLips

https://github.com/guzzle/guzzle

P
Push Pull, 2014-02-25
@deadbyelpy

Socket is slightly faster, but the gain is something like 5%.
IMHO, the benefit of working with cURL is convenience.
In general, why write bicycles? There is already the above -mentioned Guzzle and my favorite HTTPFUL (because it is simpler)
What prevented you from doing a connection test? Not much code. The result is noticeable immediately.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question