summaryrefslogtreecommitdiff
path: root/lib/WWW
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2022-07-25 08:07:52 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2022-07-25 08:07:52 +0900
commit4c915c978459dd95892b86cda79120bef5e49636 (patch)
treebb9f999371eebd583638a8935ba32fcd400a2a6d /lib/WWW
parentbac347c3605b37a1839937a689e380303a9085a4 (diff)
downloadperl-WWW-Curl-4c915c978459dd95892b86cda79120bef5e49636.tar.gz
perl-WWW-Curl-4c915c978459dd95892b86cda79120bef5e49636.tar.bz2
perl-WWW-Curl-4c915c978459dd95892b86cda79120bef5e49636.zip
Imported Upstream version 4.12upstream/4.12
Diffstat (limited to 'lib/WWW')
-rw-r--r--lib/WWW/Curl.pm30
-rw-r--r--lib/WWW/Curl/Easy.pm7
-rw-r--r--lib/WWW/Curl/Form.pm33
3 files changed, 59 insertions, 11 deletions
diff --git a/lib/WWW/Curl.pm b/lib/WWW/Curl.pm
index 054f79b..63c2fc9 100644
--- a/lib/WWW/Curl.pm
+++ b/lib/WWW/Curl.pm
@@ -6,7 +6,7 @@ use vars qw(@ISA $VERSION);
use DynaLoader;
BEGIN {
- $VERSION = '4.11';
+ $VERSION = '4.12';
@ISA = qw(DynaLoader);
__PACKAGE__->bootstrap;
}
@@ -169,6 +169,26 @@ This is how you enable sharing for a specific WWW::Curl::Easy handle:
$curl->setopt(CURLOPT_SHARE, $curlsh)
Attach share object to WWW::Curl::Easy instance
+=head1 WWW::Curl::Form
+
+ use WWW::Curl::Form;
+ my $curlf = WWW::Curl::Form->new;
+ $curlf->curl_formaddfile($filename, 'attachment', "multipart/form-data");
+ $curlf->curl_formadd("FIELDNAME", "VALUE");
+
+ $curl->setopt(CURLOPT_HTTPPOST, $curlf);
+
+Its usable methods are:
+
+ $curlf = new WWW::Curl::Form
+ This method constructs a new WWW::Curl::Form object.
+
+ $curlf->formadd(FIELDNAME, VALUE)
+ This method adds a field with a given value, to the form that is being submitted.
+
+ $curlf->formaddfile(FILENAME, DESCRIPTION, TYPE)
+ This method will add a file to the form. The description is the name of the field
+ that you form expects the data to be submitted in.
=head1 COMPATIBILITY
@@ -217,7 +237,11 @@ Not implemented and won't be as this method is considered deprecated.
=item curl_formadd
-Not yet implemented.
+Seems to be working.
+
+=item curl_formaddfile
+
+Seems to be working.
=item curl_formfree
@@ -340,7 +364,7 @@ repackaged the module into a more modern form.
=head1 COPYRIGHT
-Copyright (C) 2000-2005,2008,2009 Daniel Stenberg, Cris Bailiff,
+Copyright (C) 2000-2005,2008-2010 Daniel Stenberg, Cris Bailiff,
Sebastian Riedel, Balint Szilakszi et al.
You may opt to use, copy, modify, merge, publish, distribute and/or sell
diff --git a/lib/WWW/Curl/Easy.pm b/lib/WWW/Curl/Easy.pm
index 2f0829b..2b91f4c 100644
--- a/lib/WWW/Curl/Easy.pm
+++ b/lib/WWW/Curl/Easy.pm
@@ -5,7 +5,7 @@ use warnings;
use Carp;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
-$VERSION = '4.11';
+$VERSION = '4.12';
require WWW::Curl;
require Exporter;
@@ -23,6 +23,11 @@ require AutoLoader;
$WWW::Curl::Easy::headers = "";
$WWW::Curl::Easy::content = "";
+sub const_string {
+ my ($self, $constant) = @_;
+ return constant($constant,0);
+}
+
sub AUTOLOAD {
# This AUTOLOAD is used to 'autoload' constants from the constant()
diff --git a/lib/WWW/Curl/Form.pm b/lib/WWW/Curl/Form.pm
index 7ea117f..a2022c7 100644
--- a/lib/WWW/Curl/Form.pm
+++ b/lib/WWW/Curl/Form.pm
@@ -1,13 +1,32 @@
package WWW::Curl::Form;
use strict;
use warnings;
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
-# In development!
-#
-#require WWW::Curl;
-#use vars qw(@ISA @EXPORT_OK);
-#require Exporter;
-#require AutoLoader;
-# @ISA = qw(Exporter DynaLoader);
+$VERSION = '4.12';
+
+require WWW::Curl;
+require Exporter;
+require AutoLoader;
+
+@ISA = qw(Exporter DynaLoader);
+
+@EXPORT = qw(
+CURLFORM_FILE
+CURLFORM_COPYNAME
+CURLFORM_CONTENTTYPE
+);
+
+sub AUTOLOAD {
+
+ # This AUTOLOAD is used to 'autoload' constants from the constant()
+ # XS function.
+
+ ( my $constname = $AUTOLOAD ) =~ s/.*:://;
+ return constant( $constname, 0 );
+}
1;
+
+__END__
+