Skip to main content

A fork of httpx with support for a custom JSON serializer

Project description

HTTPJ

HTTPJ -A fork of httpx with support for a custom JSON serializer.

Test Suite Package version

  • HTTPJ is nearly identical to HTTPX. The main difference lies in two extra parameters, json_serialize and json_deserialize, which afford you precise control over the serialization and deserialization of your objects in JSON format.
  • HTTPJ will remain synchronized with the mainstream HTTPX until similar functionality emerges.

Install HTTPJ using pip:

pip install httpj

Now, let's get started:

import datetime
import pprint

import httpj
import orjson


resp = httpj.post(
    "https://postman-echo.com/post",
    json={"dt": datetime.datetime.utcnow()},
    json_serialize=lambda j: orjson.dumps(j, option=orjson.OPT_NAIVE_UTC),  # optional
    json_deserialize=orjson.loads,  # optional
)
pprint.pprint(resp.json(), indent=4)

Release Information

Fixed

  • Reintroduced supposedly-private URLTypes shortcut. (#2673)

Full changelog

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

httpj-0.27.2.tar.gz (142.7 kB view details)

Uploaded Source

Built Distribution

httpj-0.27.2-py3-none-any.whl (75.6 kB view details)

Uploaded Python 3

File details

Details for the file httpj-0.27.2.tar.gz.

File metadata

  • Download URL: httpj-0.27.2.tar.gz
  • Upload date:
  • Size: 142.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for httpj-0.27.2.tar.gz
Algorithm Hash digest
SHA256 9233d3cf7e3db81029b5963f66d0a739b7dace57e91a71e0954cf9873f812f49
MD5 7e81af859d937e48987d2aa938bafb61
BLAKE2b-256 13cb56213f98739d362292fe0b0c95cb863683673a757e0225c0cbfb4d623bda

See more details on using hashes here.

File details

Details for the file httpj-0.27.2-py3-none-any.whl.

File metadata

  • Download URL: httpj-0.27.2-py3-none-any.whl
  • Upload date:
  • Size: 75.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for httpj-0.27.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a75cd08723a28ec85101d62c0695f3da0e80bddcc88a0844d8330fc999918b06
MD5 8843d6dcff605a60a3b8e7abfa58a911
BLAKE2b-256 522ca06f0a71e404cc6711916956470e555211167301a25f12a8a9555c439379

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page