Test request. Test - testing http requests



HTTP testing server accepting GET/POST requests (9)

Webhook Tester is a great tool: https://webhook.site (GitHub)

What's important to me is that it shows the IP address of the requester, which is useful when you need to whitelist an IP address but not sure what it is.

I need a live test server that accepts my requests for basic information via HTTP GET and also allows me to POST (even though it doesn't really do anything). This is entirely for testing.

Curl --request POST \ --url https://postman-echo.com/post \ --data "This is expected to be sent back as part of response body."

("args":(),"data":"","files":(),"form":("This is expected to be sent back as part of response body.":""),"headers" :("host":"postman-echo.com","content-length":"58","accept":"*/*","content-type":"application/x-www-form-urlencoded ","user-agent":"curl/7.54.0","x-forwarded-port":"443","x-forwarded-proto":"https"),"json":("...

This desire is not available. The following are the available wishes: ["application", "args", "authorization", "blueprint", "charset", "close", "cookies", "data", "date", "endpoint", "environ"" , "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" " " "" "" "" "" "" "" "" "" "" "" "" "scheme", "minor", "flow", "url", "values"]

("wsgi.multiprocess": False, "HTTP_COOKIE": "csrftoken = YFKYYZl3DtqEJJBwUlap28bLG1T4Cyuq", "SERVER_SOFTWARE": "Werkzeug / 0.12.2", "SCRIPT_NAME": "", "REQUEST_METHOD": "GET", "PATH_INFO": " "/method/environ", "SERVER_PROTOCOL": "HTTP/1.1", "QUERY_STRING": "", "werkzeug.server.shutdown":, "HTTP_USER_AGENT": "Mozilla/5.0 (Windows NT 6.1, WOW64) AppleWebKit /537.36 (KHTML, e.g. Gecko) Chrome / 54.0.2840.71 Safari /537.36","HTTP_CONNECTION":"keep-alive","SERVER_NAME":"127.0.0.1","REMOTE_PORT":49569,"wsgi.url_scheme" :" http "," SERVER_PORT ":" 5000 "," werkzeug.request ":," wsgi.input ":," HTTP_HOST ":" 127.0.0.1:5000 "," wsgi.multithread ": False," HTTP_UPGRADE_INSECURE_REQUESTS " :" 1 "," HTTP_ACCEPT ":" text / html, application / xhtml + xml, application / xml; q = 0.9, image / webp, / ; q = 0.8 "," wsgi.version ": (1, 0)," wsgi.run_once ": False," wsgi.errors ":", mode "w" at 0x0000000002042150>, "REMOTE_ADDR": "127.0.0.1" , "HTTP_ACCEPT_LANGUAGE": "en-US, en; q = 0.8", "HTTP_ACCEPT_ENCODING": "gzip, deflate, sdch, br")

local test server nc one-liner

Set up a local test server in one line under Linux:

While true; do printf "" | nc -l localhost 8000; done

Sample request creator on another shell:

Wget http://localhost:8000

then in the first shell you will see the request appear:

GET / HTTP/1.1 User-Agent: Wget/1.19.4 (linux-gnu) Accept: */* Accept-Encoding: identity Host: localhost:8000 Connection: Keep-Alive

nc is widely available and pre-installed on Ubuntu.

Tested on Ubuntu 18.04.

What's important to me is that it shows the IP address of the requester, which is useful when you need to whitelist an IP address but not sure what it is.

I need a live test server that accepts my requests for basic information via HTTP GET and also allows me to POST (even though it doesn't really do anything). This is entirely for testing.

Curl --request POST \ --url https://postman-echo.com/post \ --data "This is expected to be sent back as part of response body."

("args":(),"data":"","files":(),"form":("This is expected to be sent back as part of response body.":""),"headers" :("host":"postman-echo.com","content-length":"58","accept":"*/*","content-type":"application/x-www-form-urlencoded ","user-agent":"curl/7.54.0","x-forwarded-port":"443","x-forwarded-proto":"https"),"json":("...

This desire is not available. The following are the available wishes: ["application", "args", "authorization", "blueprint", "charset", "close", "cookies", "data", "date", "endpoint", "environ"" , "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" " " "" "" "" "" "" "" "" "" "" "" "" "scheme", "minor", "flow", "url", "values"]

("wsgi.multiprocess": False, "HTTP_COOKIE": "csrftoken = YFKYYZl3DtqEJJBwUlap28bLG1T4Cyuq", "SERVER_SOFTWARE": "Werkzeug / 0.12.2", "SCRIPT_NAME": "", "REQUEST_METHOD": "GET", "PATH_INFO": " "/method/environ", "SERVER_PROTOCOL": "HTTP/1.1", "QUERY_STRING": "", "werkzeug.server.shutdown":, "HTTP_USER_AGENT": "Mozilla/5.0 (Windows NT 6.1, WOW64) AppleWebKit /537.36 (KHTML, e.g. Gecko) Chrome / 54.0.2840.71 Safari /537.36","HTTP_CONNECTION":"keep-alive","SERVER_NAME":"127.0.0.1","REMOTE_PORT":49569,"wsgi.url_scheme" :" http "," SERVER_PORT ":" 5000 "," werkzeug.request ":," wsgi.input ":," HTTP_HOST ":" 127.0.0.1:5000 "," wsgi.multithread ": False," HTTP_UPGRADE_INSECURE_REQUESTS " :" 1 "," HTTP_ACCEPT ":" text / html, application / xhtml + xml, application / xml; q = 0.9, image / webp, / ; q = 0.8 "," wsgi.version ": (1, 0)," wsgi.run_once ": False," wsgi.errors ":", mode "w" at 0x0000000002042150>, "REMOTE_ADDR": "127.0.0.1" , "HTTP_ACCEPT_LANGUAGE": "en-US, en; q = 0.8", "HTTP_ACCEPT_ENCODING": "gzip, deflate, sdch, br")

local test server nc one-liner

Set up a local test server in one line under Linux:

While true; do printf "" | nc -l localhost 8000; done

Sample request creator on another shell:

Wget http://localhost:8000

then in the first shell you will see the request appear:

GET / HTTP/1.1 User-Agent: Wget/1.19.4 (linux-gnu) Accept: */* Accept-Encoding: identity Host: localhost:8000 Connection: Keep-Alive

nc is widely available and pre-installed on Ubuntu.

Tested on Ubuntu 18.04.

For performance measurements, three queries were used, representing the three most typical problematic calculations. Below are these queries in the DQL language used in Doctrine. DQL allows you to implicitly describe the criteria for a JOIN operation within a WHERE. Doctrine processes all queries as a prepared statement, that is, parsing similar DQL and SQL does not occur repeatedly.

testRegistrationCount

Counting the number of registrations from the organizer is the simplest request. There is only one join, covered with indexes.

SELECT count(r.id) from Registration r, r.Event e WHERE e.organization_id = ?;

testIncome

Calculation of the organizer's income is the sum of all amounts paid by visitors. Almost the same thing, but you no longer need to count the rows, but add them up.

SELECT sum(r.sum) from Registration r, r.Event e WHERE e.organization_id = ?;

testRegCountByPartner

Counting organizer registrations attracted by a specific partner. A more complex query with two joins. It also presents increased complexity for StatMetric, as it uses a “double slice”.

SELECT count(r.id) from Registration r, r.Event e, r.Campaign c WHERE e.organization_id = ? and c.partner_id = ?;

Publications on the topic