Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question