Optimism
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Optimism
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
curl is the fastest way to poke at OP Mainnet without pulling in an SDK — ideal for sanity-checking your endpoint, debugging a malformed payload, or scripting a quick query in a shell or CI job. Every JSON-RPC call is an HTTP POST carrying a Content-Type: application/json header and a JSON body. Your API key lives in the URL path: https://optimism.therpc.io/YOUR_API_KEY. Since OP Mainnet is EVM-equivalent (chain ID 10), the same eth_* methods you would use on Ethereum L1 work here.
There are two ways to authenticate against OP Mainnet: put the key directly in the URL path (https://optimism.therpc.io/YOUR_API_KEY), or send it as a Bearer token in the Authorization header. Either way, the request itself must be an HTTP POST with Content-Type: application/json — JSON-RPC does not accept GET.