When i making a post request its returning an 302 and if i made same request from postman its working fine

Hi team,

When i make an api call with post request

in the above image i can see two api calls but i made only one api call with post() request and i did not made a Get() request . Why this Get() request happening ?
making same request using postman its working fine.

May i know the reason why this is happening ?

Sumanth P

Check the result browser to see what data you submitted and share that here. We cannot diagnose things by screenshot. The GET is a result of the 302 redirect from the POST.

This might also show what the response was and if more than a 302 was issued.

Hi ,
Please find the result browser

General Request Information
URL https://www.citybeach.com/on/demandware.store/Sites-CityBeachAustralia-Site/default/Cart-AddProduct
Request Method POST
Start Time 2021-09-29 08:11:44Z [UTC]
2021-09-29 13:41:44.446 [India Standard Time]
Request Headers
Accept /
Accept-Encoding gzip, deflate
Accept-Language en-US,en;q=0.5
Authorization Basic c3RvcmVmcm9udDpjYnN0b3JlZnJvbn=
Connection Keep-Alive
Content-Length 31
Content-Type application/x-www-form-urlencoded
Host www.citybeach.com
Referer https://www.citybeach.com/au/mooloola-belize-pencil-case/20311816-01.html
Upgrade-Insecure-Requests 1
User-Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0; Xceptance LoadTest 5.5.0) Gecko/20100101 Firefox/88.0 nvOW0OO7L8V5s6j
X-XLT-RequestId nvOW0OO7L8V5s6j
URL Query Parameters
POST Parameters
pid 2031181601012-01
quantity 1
General Response Information
Status 302 - Moved Temporarily
Load Time 403 ms
Response Headers
Cache-Control no-cache, no-store, must-revalidate, no-transform
Connection keep-alive
Content-Length 2
Date Wed, 29 Sep 2021 08:11:44 GMT
Expires 0
Location /on/demandware.store/Sites-CityBeachAustralia-Site/default/Cart-AddProduct
Set-Cookie 6cfe44d89ff906578c620ed246854b8c2f7107b8493d1882ce0e4b53dfdd50e5=d6b8aa5e2a74455a4d0239941ad9900c360b2def189b879fbb49357cbaea99b3d17fde8c8348e77315602cdeac4f89a7; Expires=Sun, 31 Oct 2021 23:59:59 GMT; Path=/; HttpOnly
X-Request-ID 7567ff233b62218c935414bf2d44c22c
section-io-id 43ec103bff0016b6f80fd251f68b3101

Thanks ,
Sumanth P

any information required ? please let me know

Have you checked the SFCC error log to see what it might have complained about, if it has?

Not really helpful… have to debug that myself… take some time, we are busy at the moment.

Okay thanks for the replay and if you need anything please let me know

I have the feeling your authorization is not right… it decodes for me to something without a “t” at the end… but that is needed. Of course, that does not show why this is 302 … can you send me the creds via a direct message here I guess

Solved or still a need to look for that?

The problem is at our application not in our code
any way thanks for your help for spending time