Curl and other network functions
Network access to outside websites is disabled, BUT there are still ways to test CURL or other functions that require network access. All network traffic on port 80 and port 443 (https) are redirected to a test server where you can request some test files or request response codes.Sample files
There are a bunch of sample files available to play around with:- books.json
- books.xml
- compressed.tar.gz
- compressed.zip
- image.gif
- image.jpg
- image.png
- index.html (this file)
- pdf-sample.pdf
- people.csv
- README.txt
- script.js
- style.css
To get books.xml request for example: http://example.com/books.xml or https://google.com/books.xml
To get people.csv: http://parser.onlinephp.io/people.csv or http://example.com/people.csv
Click here for a demo!
And you can always upload your own file like this for example:- file_put_contents("persons.csv", "person1, person2, person3");
Basic Authentication
Request any url ending with /auth to request a page with basic authentication. Username is user and password is password.HTTPS Requests
Using the fopen wrappers you are able to request the sample files like usual, but using CURL you will need to add:curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); to be able to request the file.
See the demo for an example.
Request Status Codes
You can request a return of a status code by using "/error/[errorcode]".- 404 Example: http://domain.com/error/404 will return error code 404
- 500 Example: http://whatever.net/error/500 will return error code 500
- You can use the following status codes: 100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 421, 422, 423, 424, 425, 426, 428, 429, 431, 451, 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, 511