ok edited, i don't know if the posted code above was sufficient, so just in addition i post the full code here
#!d:\perl\bin\perl.exe use warnings; use strict; use CGI qw(:standard); use CGI::Carp 'fatalsToBrowser'; use LWP; use HTTP::Request::Common; use HTTP::Cookies; use HTTP::Headers; use LWP::Debug qw(+); use URI::Escape qw(uri_escape_utf8 uri_escape uri_unescape); use Encode; print "Content-type:text/html;charset=UTF-8\n\n" ; our $page; my $jsessionID; my $viewState; sub extractLinks(){ $page =~ s/\"\/search(\/.[^ ]+)+\"/https:\/\/patentscope\.wipo\.int\/s +earch$1\" /g; } sub extractJSessionID(){ my $jsessionID=""; if($page =~ /(jsessionid=[A-Z0-9]*\.wapp[0-9]n[A-Z])/si){$jsessionID = + $1;} return $jsessionID; } sub extractViewStateID(){ my $ViewState=""; if($page =~ /javax.faces.ViewState:0\" value=\"(-?[0-9:]*)/si){ $ViewState = "javax.faces.ViewState=".$1;} $ViewState = join( "%3A", split(":", $ViewState) ); return $ViewState; } my $proxy = 'http://localhost:5865'; my $ua = new LWP::UserAgent(keep_alive => 0, ssl_opts => { verify_host +name => 0 }); $ua->proxy(['https', 'http', 'ftp'], $proxy); $ENV{HTTPS_PROXY} = $proxy; $ENV{'PERL_LWP_SSL_CA_PATH'} = "D:\\CA_certs\\input\\certs"; my $cookie_jar = new HTTP::Cookies(); $ua->cookie_jar($cookie_jar); $ua->agent('Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident +/5.0)'); #download init page for extracting jsession id my $response = $ua->get("https://patentscope.wipo.int/search/en/search +.jsf"); die "Couldn't get $url", $response->status_line unless $response->is_s +uccess; print $response->status_line; $page = $response -> decoded_content; extractLinks(); $jsessionID = extractJSessionID(); $viewState = extractViewStateID(); print $page; my $param ='simpleSearchSearchForm=simpleSearchSearchForm&simpleSearch +SearchForm%3Aj_idt379=ALLTXT&simpleSearchSearchForm%3AfpSearch=brushl +ess+motor&simpleSearchSearchForm%3AcommandSimpleFPSearch=Search&simpl +eSearchSearchForm%3Aj_idt447=workaround&$viewState'; #--------- problem part : my $request = HTTP::Request->new('POST', 'https://patentscope.wipo.int +/search/en/search.jsf'); $request->header('Content-Type' => 'application/x-www-form-urlencoded' +); $request->header('Referer' => "https://patentscope.wipo.int/search/en/ +search.jsf"); $request->header('Accept' => 'text/html,application/xhtml+xml,applicat +ion/xml;q=0.9,*/*;q=0.8'); $request->header('Connection' => 'keep-alive'); $request->header('Cookie' => uc $jsessionID.'\; ABIW=balancer.cms41\; +wipo_language=en\; BSWA=balancer.bswa2'); $request->content($param); $response = $ua->request($request); $page = $response->decoded_content(); print $page;

In reply to Re^2: Authen::Negotiate Wep-Programming by amitsq
in thread Authorization Negotiate Wep-Programming by amitsq

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.