#!/usr/bin/perl


use warnings;
use strict;
use LWP::UserAgent;


my $url = 'http://genehopper.de/rest/qtlizer';


# Note: in the current version of Qtlizer, queries including gene identifier 
# and chromosomal positions of variants taker longer than if using rsids only

my %parameters = (
	"q" =>  "rs4284742, rs2070901, DEFA1, ENSG00000122194, hg19:19:45412079, hg38:6:12903725",
	"corr" => 0.8, # optional
	"ld_method" => "r2" # optional
);


my $url_with_pars = "$url?";
$url_with_pars .= $_."=".$parameters{$_}."&" for keys(%parameters);


my $ua = LWP::UserAgent->new(); 
my $response = $ua -> post($url_with_pars);
my $content = $response -> decoded_content();


print $content."\n";
