Skip to content
← Back to Community
PHP Curl function
Profile icon
cypher137

Does anyone know a way to use the php Curl function in the php web server ?

Voters
Profile icon
Augusto-Vasques
Profile icon
EmangGek
Profile icon
TheDefinitionis
Profile icon
cypher137
Comments
hotnewtop
Profile icon
TheDefinitionis

cURL for PHP should be working but only when you choose "PHP Legacy" using CLI version. Example

Profile icon
NotTani

Unfortunately, to the best of my knowledge, cURL is not included in repl.it's PHP Web Server. However, if you want to make web requests, you can use PHP's built in file_get_contents, which provides a easy (if slightly haphazard) way to make web requests. There is official docs on file_get_context here (scroll to the bottom for a web request example) and a guide to contexts (how you'll specify method/headers) here.
Hope this helps!