gurizzu/go-reqws ? reverse-engineered prompt

Reverse engineered prompt

Build me a small Go library for making HTTP requests and WebSocket connections with one simple API.

I want it to feel easy to use from a normal Go app, with context support, clean functional options, and good defaults. It should handle basic requests, JSON responses, bearer tokens, query params, forms, file uploads, and let me inspect status codes and parse response bodies easily. Add retry support for temporary failures with exponential backoff, plus WebSocket reconnect support when the connection drops.

I also want middleware style hooks so I can run code before a request, after a response, and when errors happen. Make errors easy to check in code, especially for HTTP and WebSocket failures. Keep dependencies minimal and make the package production friendly.

Please include a few working examples in the repo, and if you need current docs for the WebSocket package or recent Go behavior, look them up online.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab