mardi 29 septembre 2015

Why Response.Cookies is empty?

When I run this python script

import requests

main_page_request = requests.get("http://carkit.kg/")
cookie = main_page_request.cookies.get("csrftoken", "")

I'm getting proper result, but when I run this code at C#:

string url = @"http://carkit.kg";

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

Debug.Log(response.Cookies["csrftoken"]); // prints "Null"

it says that response.Cookies is empty. What is the problem?




Aucun commentaire:

Enregistrer un commentaire