About
Repo displays a simple HTTP request-response, using JSON objects. It can be used to simulate a client request (from Python, using the requests module) and a corresponding server response (from Golang, using the gin module).
Instructions
- Install and set up
go&&postgres psql - Set up Python3.4 and pip3
- Install requests module using the following command
sudo pip3 install requests - Install gin using the following command
go get github.com/gin-gonic/gin - Install postgres psql package using command
go get github.com/jackc/pgx - Install this module for http requests
go get github.com/parnurzeal/gorequest - Clone the repo
- On one terminal window (say t1), run
go run server.go - On another terminal window (say t2), run
cd API - run
create_table.pydeletes the existing entries ofusersandusersdescriptiontables if table exists , else create tables - run
createuserid.pycheck and validate anemailwith it’s userid - run
dumpintousers.pydump data intouserstable - run
dumpintousersdescription.pydump data intousersdescriptiontable - run
findDeviceidPlatform.pyit finds thedeviceidandplatform - On another terminal window, run
python3.4 findDeviceidPlatform.py - The request should be visible on server.go and the corresponding response should be visible on the terminal running the python program
Other python Modules used
random, psycopg2, json
install python modules sudo pip3 install <package>
Contributors
- Ashutosh Kumar Gupta