Skip to main content

HTTPX fork with custom JSON serializer support

Project description

HTTPJ

HTTPJ HTTPX fork with custom JSON serializer support.

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.28.1.tar.gz (139.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

httpj-0.28.1-py3-none-any.whl (72.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: httpj-0.28.1.tar.gz
  • Upload date:
  • Size: 139.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.8

File hashes

Hashes for httpj-0.28.1.tar.gz
Algorithm Hash digest
SHA256 0dfbb436dff634e9bad35922f795f0a9d7221a670d9459902b7cff3d01117378
MD5 f2ac6eaccccd6d606ff352bf3d3b3b42
BLAKE2b-256 c3646d357c750ec4b2eb3e64aa311fcdaa542208c7310d43e16966c1f3923ef9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: httpj-0.28.1-py3-none-any.whl
  • Upload date:
  • Size: 72.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.8

File hashes

Hashes for httpj-0.28.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a276ac7347eebd29bed7f841c5c13108081b154dbfb70decc52238daf0cabdcb
MD5 0fbec90aafd28825e70924d5959a7b7f
BLAKE2b-256 fd540dded96d993af150c875f81de4fe5aa908b9c28294437255fccd623e00b3

See more details on using hashes here.

Supported by

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