Am having a problem from my script. this is the error am getting Forbidden (403) CSRF verification failed. Request aborted. You are seeing this message because this HTTPS site requires a “Referer header” to be sent by your Web browser, but none was sent. This header is required for security reasons, to ensure that your browser is not being hijacked by third parties.
#!/usr/bin/perl use lib '.'; use strict; use warnings; use HTTP::Tiny; use JSON; use LWP::UserAgent; my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 }, ); $ua->agent("MyApp/0.1"); my $referer = $ENV{HTTP_REFERER}; my $callback = ""; my $address = ""; my $pending = "1"; my $confirmations = "1"; my $email = ''; my $json = "1"; my $post = "0"; my $priority = "default"; my $multi_token = "0"; my $convert = "0"; my $req = HTTP::Request->new(POST=>"https://link?callback=$callback&ad +dress=$address&pending=$pending&confirmations=$confirmations&email=$e +mail &post=$post&json=$json&priority=$priority&multi_token=$multi_token&con +vert=$convert"); $req->referer($referer); my $Response_Req = $ua->request($req); if($Response_Req->is_success){ print $Response_Req->content ."\n"; } else{ print "Error: " . $Response_Req->status_line; }
In reply to Referer header by frank1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |