sergio

sergio

How does Postman generate the Cookie for the request to work?

This isn’t really an Elixir question, moreso a general Postman question.

I’m using Postman to HTTP GET this URL:

https://redsky.target.com/redsky_aggregations/v1/web/plp_search_v2?key=9f36aeafbe60771e321a7cc95a78140772ab3e96&category=0snqs&channel=WEB&count=24&default_purchasability_filter=true&faceted_value=55e6uZakkosZ5tdv0Z55dgnZnqueqc6d44fZ54jftZ4bmrplmkj9nZpyq1lZwlkrxZkpg5pZ4bmrpllkdobZ56ds9Zfmt6gZ4bmrpli4j3qZ57yv4Z55kh9Z4bmrplqkc0lZpu2iyZftml9&include_sponsored=true&new_search=false&offset=48&page=%2Fc%2F0snqs&platform=desktop&pricing_store_id=746&scheduled_delivery_store_id=746&sort_by=newest&store_ids=746%2C1075%2C3424%2C2843%2C2848&useragent=Mozilla%2F5.0+(Windows+NT+10.0%3B+Win64%3B+x64)+AppleWebKit%2F537.36+(KHTML%2C+like+Gecko)+Chrome%2F119.0.0.0+Safari%2F537.36&visitor_id=018C306A752F02019455A6119EB0FB86&zip=33196

The request works and it returns the JSON I’m expecting. When I use the “copy as curl” feature, the request works in my Terminal.

curl --location ‘https://redsky.target.com/redsky_aggregations/v1/web/plp_search_v2?key=9f36aeafbe60771e321a7cc95a78140772ab3e96&category=0snqs&channel=WEB&count=24&default_purchasability_filter=true&faceted_value=55e6uZakkosZ5tdv0Z55dgnZnqueqc6d44fZ54jftZ4bmrplmkj9nZpyq1lZwlkrxZkpg5pZ4bmrpllkdobZ56ds9Zfmt6gZ4bmrpli4j3qZ57yv4Z55kh9Z4bmrplqkc0lZpu2iyZftml9&include_sponsored=true&new_search=false&offset=48&page=%2Fc%2F0snqs&platform=desktop&pricing_store_id=746&scheduled_delivery_store_id=746&sort_by=newest&store_ids=746%2C1075%2C3424%2C2843%2C2848&useragent=Mozilla%2F5.0%2B(Windows%2BNT%2B10.0%3B%2BWin64%3B%2Bx64)%2BAppleWebKit%2F537.36%2B(KHTML%2C%2Blike%2BGecko)%2BChrome%2F119.0.0.0%2BSafari%2F537.36&visitor_id=018C306A752F02019455A6119EB0FB86&zip=33196
–header ‘Cookie: mitata=ZDY4NmU2NDA3NjFlNGE2YjQ0YjAxY2NkMzY1OTU3MmRiNDFiOTAyY2UzOTRmMmQ3NTBlZDZlNDE3M2IxZTY2ZA== /@#/1701625898_/@#/cttujxbBJYtyKSbd_/@#/NGZhODVhZmNjY2UyZmJhOWE3MTk1MzQ0NWI5NmQwNDk4YTBhZTY2MWI0YjI1ZjQ5YzFhNmEwMjVhOWZmYzNlOA==_/@#/000’

After a few minutes the CURL request breaks, and I have to use Postman to make the GET request again because I noticed that the Cookie value is being changed automatically by Postman.

My question is how is Postman automatically refreshing this cookie value and how can I do this myself in Elixir code?

Is it doing some kind of preflight hit to the URL?

Marked As Solved

D4no0

D4no0

Have you checked the Set-Cookie header in the response? This is the mechanism used to store cookies in the browser.

Where Next?

Popular in Questions Top

_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
JulienCorb
I am trying to implement my new.html.eex file to create new posts on my website. new.html.eex: <h1>Create Post</h1> <%= ...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36128 110
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

We're in Beta

About us Mission Statement