http icon indicating copy to clipboard operation
http copied to clipboard

Doesn't work "http head request" with cookie?

Open lavara123 opened this issue 3 years ago • 0 comments

Can't make request with cookie.

This is how it's done in curl:

curl -sS -I "url" -H "Cookie: sjv=123"

This is how it's done in python

import requests

response = requests.head('url', cookies={'sjv': '123'})

Dart http not working:

import 'package:http/http.dart' as http;

void main() async {
  var res = await http.head('url', headers: {'Cookie': 'sjv=123'});
  
  print(res.body);
}

lavara123 avatar Jan 06 '22 19:01 lavara123