Skip to content

Noob Question: Differences between httpx and httpx-ws #17

Answered by frankie567
FrankC01 asked this question in Q&A
Discussion options

You must be logged in to vote
  1. The purpose of HTTPX is to make HTTP requests (GET, POST, PUT...) and receive the response, whether it's HTML, JSON or whatever.
  2. HTTPX-WS is a tool built on top of HTTPX to help you talk with WebSockets. It relies on HTTPX to perform the initial connection and then gives you access to a set of useful methods to send and receive data from a WebSocket.

So, they are complimentary in the sense that they don't serve the same purpose. In your client implementation, you'll probably have two approaches:

  • The HTTP approach: I call a function, I get a result, e.g:
data = sui_client.get_transaction("TRANSACTION_ID")
print(data)
  • The WebSocket approach: I open a connection, I receive events in rea…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by FrankC01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants