Skip to content

Instantly share code, notes, and snippets.

View sankalpjonn's full-sized avatar

Sankalp Jonna sankalpjonn

View GitHub Profile
python manage.py runserver
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
#include rest_framework here
'rest_framework',
nc -l 3000
HTTP/1.1 200 OK
Content-Length: 13
Content-Type: text/plain
Hello world!
echo "$(cat response.http)" | nc -l 3000
while true; do { echo "$(cat response.http)"; } | nc -l 3000; done
./ngrok http 3000
curl -XPUT 'http://localhost:3000/some/url/path?query_param_1=value1&query_param2=value2' \
-H "Content-Type: application/json" \
-H "X-Custom-Header-Foo: Bar" \
-d '{"key1": "val1", "key2": "val2"}'
# Start the netcat server in a loop on terminal window #1
while true; do { echo "$(cat response.http)"; } | nc -l 3000; done
# Run ngrok on terminal window #2
./ngrok http 3000
{
"count": 10,
"next": "http://localhost:8000/note/all?page=2",
"previous": null,
"results": [
{
"id": 11,
"title": "Blog post 7",
"content": "content 7",
"last_udpated_on": "2021-01-09T01:24:26.048558Z",