A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

Perl http stuff - mcpaste

Perl http stuff

Von humpi, 8 Jahre vorher, geschrieben in Plain Text, aufgerufen 2'590 mal.
URL https://mcpaste.de/view/2934039f Einbetten
Paste herunterladen oder Rohtext anzeigen
  1.         #########HTTP STUFF#########
  2.         sub executeRequest {
  3.                 my ($self) = shift;
  4.                 my $request = shift;
  5.  
  6.                 if ($self->{mAKey} eq "" && $self->{mSKey} eq "") {    
  7.                                 $request->header('X-Cookie' => $self->{mToken});
  8.                         } else {
  9.                                 $request->header('X-ApiKeys' => "accessKey=".$self->{mAKey}."; secretKey=".$self->{mSKey}.";");
  10.                 }
  11.                
  12.                 my $ua = LWP::UserAgent->new(ssl_opts => { verify_hostname =>0});
  13.                
  14.                 #print "DEBUG: ".$request->as_string."\n";
  15.                
  16.                 my $response = $ua->request($request);
  17.                 return $response;      
  18.         }
  19.        
  20.         sub executepost {
  21.                 my ($self) = shift;
  22.                 my $url = shift;       
  23.                 my $data = shift;
  24.                
  25.                 my $request = HTTP::Request->new(POST => $url);
  26.                 $request->content_type('application/x-www-form-urlencoded');
  27.                 $request->content($data);              
  28.                
  29.                 return $self->executeRequest($request);
  30.         }
  31.         sub executepostjson {
  32.                 my ($self) = shift;
  33.                 my $url = shift;       
  34.                 my $data = shift;
  35.                
  36.                 my $request = HTTP::Request->new(POST => $url);
  37.                 $request->content_type('application/json');
  38.                 $request->content($data);              
  39.                
  40.                 return $self->executeRequest($request);
  41.         }
  42.                        
  43.         sub executeget {
  44.                 my ($self) = shift;
  45.                 my $url = shift;
  46.  
  47.                 my $header = HTTP::Request->new(GET => $url);
  48.                 my $request = HTTP::Request->new('GET', $url, $header);
  49.                 return $self->executeRequest($request);
  50.         }
  51.        
  52.         sub executedelete{
  53.                 my ($self) = shift;
  54.                 my $url = shift;
  55.        
  56.                 my $request = HTTP::Request->new(DELETE => $url);
  57.                 my $response = $self->executeRequest($request);
  58.                 return $response;      
  59.         }

Antwort auf "Perl http stuff"

Hier kannst Du auf den Paste von oben antworten

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876