Skip to content

Instantly share code, notes, and snippets.

@IanKemp
Created November 22, 2018 10:34
Show Gist options
  • Save IanKemp/dfaafd6569aa7a7f4563ba1eff111e4b to your computer and use it in GitHub Desktop.
Save IanKemp/dfaafd6569aa7a7f4563ba1eff111e4b to your computer and use it in GitHub Desktop.
using System;
using System.Net.Http;
namespace ConsoleApp18
{
class Program
{
static void Main(string[] args)
{
var client = new HttpClient();
client.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0");
client.DefaultRequestHeaders.Add("Accept-Language", "sv-SE,sv;q=0.8,en-US;q=0.5,en;q=0.3");
// other headers...
var postData = "search_text=tomat&dummy=&search_type=all&rec_cats\"%\"5B\"%\"5D=all&submit_search=S\"%\"F6k&recid=&offset=0&searchid=";
var response = client.PostAsync("https://kokboken.ikv.uu.se/sok.php", new StringContent(postData)).Result;
var html = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(html);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment