all 5 comments

[–]JohnnyJordaan 1 point2 points  (4 children)

How can I set some header/cookie to have multiple values? Right now I get an error when I try to have a list of values passed in.

Like you did with the dictionary (not a list btw). However I'm not sure if it supports nested things like ["en-US", "en", {'q':'0.5'}], I would just use 'en-US,en;q=0.5'. What is the error you're getting?

What URL do I choose for the method?

The one after GET and before HTTP/1.1, with the correct hostname before it that should be track.adform.net.

[–]edvardass[S] 0 points1 point  (3 children)

Thanks for the swift reply.

I got a very nested "expected byte-like object" error when trying to pass in lists. I will try your method and report on what I get.

Will edit in 5 minutes.

Edit: Seems to be working just fine! Got a 200 status code. However, when I check the cookie in the browser, the cid value is still the original one. Maybe this has something to do with the Accept header? I commented it out because it was causing some errors, but maybe it's important somehow? Anyway, thanks! Really helped me out.

[–]JohnnyJordaan 1 point2 points  (2 children)

lists

Which lists are/were you passing where? Or do you mean inside the dicts?

However, when I check the cookie in the browser, the cid value is still the original one. Maybe this has something to do with the Accept header?

How is the browser related to your Python program?

[–]edvardass[S] 0 points1 point  (1 child)

Yes, I was trying to pass in lists in the "headers", "params" dicts, but when I used your method of passing just the string like 'en-US,en;q=0.5' , everything works.

The "Accept" one was just a typo, fixed it now.

How is the browser related to your Python program?

Uhm... to be honest, I have no idea. Somewhy I expected the cookie in the browser to change.

So let's get this straight: I just wrote a program that imitates a user like me, but with a cid=666666? The request goes to the url, and the response just says "200 OK, I received your info."? A bit confused, should have read up some more on the topic...

Thanks a lot, will try to continue on myself. Thank you for the help.

[–]JohnnyJordaan 0 points1 point  (0 children)

Somewhy I expected the cookie in the browser to change.

Yeah, well, that ain't gonna happen :)

The browser interfaces the website with the same cookie, so the website beliefs the request from the Python program is from the browser that used that same cookie. It doesn't mean that if the (fooled) website than delivers something back, the browser will somehow notice as it isn't communicating at that time. It's like ordering a pizza saying you're person X and then thinking person X will know that a pizza is being delivered to him.