# RpcTransport.fromHttp

Creates a HTTP JSON-RPC Transport from a URL.

## Imports

:::code-group
```ts [Named]
import { RpcTransport } from 'ox'
```

```ts [Entrypoint]
import * as RpcTransport from 'ox/RpcTransport'
```
:::

## Examples

```ts twoslash
import { RpcTransport } from 'ox'

const transport = RpcTransport.fromHttp(
  'https://1.rpc.thirdweb.com'
)

const blockNumber = await transport.request({
  method: 'eth_blockNumber'
})
// @log: '0x1a2b3c'
```

## Definition

```ts
function fromHttp<raw, schema>(
  url: string,
  options?: fromHttp.Options<raw, schema>,
): Http<raw, RpcSchema.ToGeneric<schema>>
```

**Source:** [src/core/RpcTransport.ts](https://github.com/wevm/ox/blob/main/src/core/RpcTransport.ts#L226)

## Parameters

### url

* **Type:** `string`

URL to perform the JSON-RPC requests to.

### options

* **Type:** `fromHttp.Options<raw, schema>`
* **Optional**

Transport options.

#### options.fetchFn

* **Type:** `{ (input: RequestInfo | URL, init?: RequestInit): Promise; }`
* **Optional**

Function to use to make the request.

#### options.fetchOptions

* **Type:** `Omit)`
* **Optional**

Request configuration to pass to `fetch`.

#### options.timeout

* **Type:** `number`
* **Optional**

Timeout for the request in milliseconds.

## Return Type

HTTP JSON-RPC Transport.

`Http<raw, RpcSchema.ToGeneric<schema>>`
