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.