API Design
System will expose 2 APIs
- API to register long URL and get the short URL in return. --> /api/short
- Request Method - POST
- Request {"longurl":""}
- Response{"shorturl":""}
- API to get the long url when hit the short url. /api/{shorturl}
- Request Method - GET
- Response Text long url with Response Http code 304 move temporarily. This way browser will redirect to long url.