Skip to content

Instantly share code, notes, and snippets.

@mondwan mondwan/
Last active Dec 2, 2015

What would you like to do?
HTTP request with netcat or openssl


This is a document about how to test HTTP requests by running openssl or nc


  • Edit payload, pathanme, ip etc


If you are running simulator with HTTPS, you need openssl

    $> cat example_post_req.txt | \
        openssl s_client -cert cert.pem  -connect

Netcat (nc)

If you are running simulator with HTTP, nc is good enough.

    $> cat example_post_req.txt | nc IP 80
POST /cli/core HTTP/1.1
Connection: keep-alive
Content-Length: 53
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36
Content-Type: application/json; charset=UTF-8
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8,zh-TW;q=0.6,zh;q=0.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.