Issue title: When using the custom middleware, If I want to pass some parameters to the  API, how should I do?  Through query parameter or via path parameter? 
 Issue body: ### First Check

- [X] I added a very descriptive title to this issue.
- [X] I used the GitHub search to find a similar issue and didn't find it.
- [X] I searched the FastAPI documentation, with the integrated search.
- [X] I already searched in Google "How to X in FastAPI" and didn't find any information.
- [X] I already read and followed all the tutorial in the docs and didn't find an answer.
- [X] I already checked if it is not related to FastAPI but to [Pydantic](https://github.com/samuelcolvin/pydantic).
- [X] I already checked if it is not related to FastAPI but to [Swagger UI](https://github.com/swagger-api/swagger-ui).
- [X] I already checked if it is not related to FastAPI but to [ReDoc](https://github.com/Redocly/redoc).

### Commit to Help

- [X] I commit to help with one of those options 👆

### Example Code

```python
from fastapi import FastAPI, Request

app = FastAPI()

@app.middleware("http")
async def add_process_time_header(request: Request, call_next):
    start_time = time.time()
    response = await call_next(request)
    process_time = time.time() - start_time
    response.headers["X-Process-Time"] = str(process_time)
    return response
```


### Description

Assume that, I Should pass one parameter(eg: query) to the middleware (add_process_time_header), should should I pass the parameter and how to access it inside the middleware?  

### Operating System

Linux

### Operating System Details

_No response_

### FastAPI Version

Flask-API==2.0

### Python Version

3.6.9

### Additional Context

_No response_
 Comments: 
 Comment 0: It will be in that request object https://www.starlette.io/requests/
 Comment 1: @jgould22  Thanks for your reply. But could you please elaborate more? 
Here is the actual scenario.

`from fastapi import FastAPI, Request

app = FastAPI()

@app.middleware("http")
async def middlewareBlock(request: Request, call_next):
    print("Middleware called")
    response = await call_next(request)
    #Body parameter query should print here , 
    return response`

class RequestStructure(BaseModel):
    query: str


@app.api_route('/v1/ask', methods=['GET', 'POST', 'OPTIONS'])
async def ask(querydetails:RequestStructure,token: str = Header(None)):
    print("middleware completed")`

So I want to call the API  **/v1/ask** by passing one parameter **query**. That query parameter should access from the middleware. Here is the expected output. 

**Middleware called**
**query value**
**middleware completed**

To display like this how should I  call the API **/v1/ask** with query value?


 Comment 2: Tried two methods
**1 - Method 1** 
```
out = get('http://localhost:7072/v1/ask?' + 'query=' + query,
            headers={"value":value})
print(out.json())
```
Output 
**Middleware called
query value**

**2 - Method 2**
```
url             = "http://localhost:7072/v1/ask"
payload         = json.dumps({
                          "query": query
                          })
headers         = {"value": value}
out        = requests.request("GET", url, headers=headers, data=payload) 
print(out.json()) 
```
output
Middleware called
middleware completed


None of the methods I tried gave the expected output 
**Middleware called
query value
middleware completed**
 Comment 3: Just a quick example to give you an idea.

```python
import time

from fastapi import FastAPI, Request

app = FastAPI()


@app.middleware("http")
async def add_process_time_header(request: Request, call_next):
    start_time = time.time()
    response = await call_next(request)
    process_time = time.time() - start_time
    if request.query_params.__contains__("set-process-time"):
        response.headers["X-Process-Time"] = str(process_time)
    return response


@app.get("/")
async def root():
    return {"message": "Hello World"}

```
URL: http://116.69.203.115:8000/?set-process-time=1
 Comment 4: @includeamin Thank you. 
 Comment 5: @includeamin Thank you. 
 Comment 6: If you are satisfied with the response, you might want to close the question.
{'source': 'GithubIssues', 'repo_name_with_owner': 'tiangolo/fastapi', 'issue_id': 1183321226, 'repo_stars': 51076.0}