Shared HTTP helper used by network-backed services.
The helper JSON-encodes request bodies, sends them with Req, and normalizes
HTTP and transport failures into PingPong result tuples. It is intentionally
small and service-agnostic so service modules can focus on mapping their own
payloads and options.
Summary
Functions
Sends a JSON POST request.
Functions
@spec post(binary(), map(), integer()) :: PingPong.result()
Sends a JSON POST request.
success_status defaults to 200. Services such as Discord can pass a
different status, for example 204.
Return values
{:ok, response}for the expected HTTP status{:error, {:error_response, response}}for other HTTP responses{:error, {:error, reason}}for transport errors{:error, {:unknown_response, response}}for unexpectedReqresults