I am trying to integrate Bugzilla with ReviewBoard writing code in perl. I have tried to write a code. curl command which is working
curl -k -H "Authorization: Basic YWRtaW4=" -X POST -d "{\"repository_ +path\":":pserver:user:pwd@svn:/opt/cvsroot",\"username\":"admin",\"pa +ssword\":"admin",\"submit-as\":"admin"}" "http://codereview.xyz.com/a +pi/r/new/"
It is giving me full html page with js error
#!/usr/local/bin/perl use LWP::UserAgent; use MIME::Base64; $url="http://codereview.xyz.com/api/review-requests/"; $newurl="http://codereview.xyz.com/r/new/"; $user="admin"; $pwd="admin"; $text="$user:$pwd"; $text = encode_base64($text); #print "Encoded text: $text\n"; %param =( "repository_id" =>"cvsrepo", "repository_path" =>":pserver:user:pwd\@svn:/opt/cvsroot", "username" => "admin", "password" => "admin", "submit-as" => "username", ); my $ua = LWP::UserAgent->new; $ua->timeout(TIMEOUT); $ua->protocols_allowed(['http', 'https']); $ua->default_header('Basic' => $text); $ua->credentials($newurl,$user,$pwd); $resp = $ua->get($url); print($resp->status_line(), "\n"); print("Add handler:\n"); $ua->add_handler( response_header => sub { print "HANDLER\n"; +}, %param); print $ua->handlers('response_header', $resp)."\n"; push @{ $ua->requests_redirectable }, 'POST'; print $ua->show_progress."\n"; my $response = $ua->post($newurl,%param); if ($response->is_success) { print $response->decoded_content; } else { die $response->status_line; }
Error its not posting ..
<h1>JavaScript is turned off</h1> <p>Review Board requires JavaScript in order to function. Please turn it on in your browser preferences. <p>Firefox users: if you prefer to turn on JavaScript only for specific sites, we recommend the <a href="https://addons.mozilla.org/en-US/firefox/addon/722">NoSc +ript extension</a>.</p>

In reply to LWP Authorisation issue by kapila

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.