PHP 8.2.30
Preview: form_post.py Size: 564 B
/proc/thread-self/root/opt/hc_python/share/doc/pycurl/examples/quickstart/form_post.py

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et

import pycurl
try:
    # python 3
    from urllib.parse import urlencode
except ImportError:
    # python 2
    from urllib import urlencode

c = pycurl.Curl()
c.setopt(c.URL, 'https://httpbin.org/post')

post_data = {'field': 'value'}
# Form data must be provided already urlencoded.
postfields = urlencode(post_data)
# Sets request method to POST,
# Content-Type header to application/x-www-form-urlencoded
# and data to send in request body.
c.setopt(c.POSTFIELDS, postfields)

c.perform()
c.close()

Directory Contents

Dirs: 1 × Files: 15

Name Size Perms Modified Actions
- drwxr-xr-x 2025-04-04 08:01:21
Edit Download
311 B lrw-r--r-- 2025-04-04 08:01:21
Edit Download
291 B lrw-r--r-- 2025-04-04 08:01:21
Edit Download
483 B lrw-r--r-- 2025-04-04 08:01:21
Edit Download
250 B lrw-r--r-- 2025-04-04 08:01:21
Edit Download
564 B lrw-r--r-- 2025-04-04 08:01:21
Edit Download
583 B lrw-r--r-- 2025-04-04 08:01:21
Edit Download
447 B lrw-r--r-- 2025-04-04 08:01:21
Edit Download
498 B lrw-r--r-- 2025-04-04 08:01:21
Edit Download
403 B lrw-r--r-- 2025-04-04 08:01:21
Edit Download
454 B lrw-r--r-- 2025-04-04 08:01:21
Edit Download
472 B lrw-r--r-- 2025-04-04 08:01:21
Edit Download
300 B lrw-r--r-- 2025-04-04 08:01:21
Edit Download
2.05 KB lrw-r--r-- 2025-04-04 08:01:21
Edit Download
498 B lrw-r--r-- 2025-04-04 08:01:21
Edit Download
357 B lrw-r--r-- 2025-04-04 08:01:21
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).