Ravindra BagaleCourses & study guides मराठी Track your progress

Ravi Sir's Cards › AWS

Why return 302 instead of 200 with the long URL?

What is a VPC: your own private network inside one AWS Region, example ThreeTierVpc 10.0.0.0/16.

Why return 302 instead of 200 with the long URL? Browsers automatically follow the Location header. That is what users expect from a short link. A JSON 200 forces every client (browser, WhatsApp preview, curl scripts) to special-case your API. Lambda returns statusCode 302 and headers Location = longUrl from DynamoDB GetItem.
Why return 302 instead of 200 with the long URL? · Download PNG
Read card text

What this card says

What it is

Browsers automatically follow the Location header. That is what users expect from a short link.

Why it matters

A JSON 200 forces every client (browser, WhatsApp preview, curl scripts) to special-case your API.

How / example

Lambda returns statusCode 302 and headers Location = longUrl from DynamoDB GetItem.

See all AWS revision cards