Question: I want to fit parent div height to fit it's child

that means I want height of parent div to fit red color

and green part will hide

<https://jsfiddle.net/zfpwb54L/>

```
<style>
.container {
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
  width: 100%;
}
.section {
  padding: 20px 0;
  position: relative;
}
.style_content {
    color: #27272a;
    max-width: 700px;
    position: relative;
    text-align: center;
    z-index: 9;

}

</style>

<div id="parent" style="background-color:green; position: relative;  direction: rtl;width:fit-content;">
    <div style="position: absolute; inset: 0px;"></div>
    <div  style="width: 280px;; ">
        <div id="child" style="background:red;flex: 0 0 auto; width: 1400px;  transform-origin: right top 0px; transform: matrix(0.2, 0, 0, 0.2, 0, 0);">
            <section class="section">
                <div class="style_content container">
                    <div><h1>Hello</h1></div>
                     <div><p>that is for test.that is for test.that is for test.that is for test.that is for test.
                     that is for test.that is for test.that is for test.that is for test.that is for test.that is for test.that is for test.that is for test.</p></div>
                    <a href="#" target="_blank">click me</a>
                </div>
            </section>                  
        </div>
    </div>
</div>

```

Answer: 
For testing your agent in a custom environment alter the endpoint URL to

`https://dialogflow.googleapis.com/v2/projects/my-project-id/agent/environments/<env-name>/users/-/sessions/123456789:detectIntent`

curl command:

```
curl -X POST \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "x-goog-user-project: PROJECT_ID" \
    -H "Content-Type: application/json; charset=utf-8" \
    -d @request.json \
    "https://dialogflow.googleapis.com/v2/projects/my-project-id/agent/environments/<env-name>/users/-/sessions/123456789:detectIntent"

```
Like [@SakshiGat](https://stackoverflow.com/users/15750473/sakshi-gatyan) mentioned, the curl URL was invalid.

Invalid URL:
"https://dialogflow.googleapis.com/v2/projects/<project\_name>/agent/environments/DEV/sessions/<session\_id>:detectIntent"

Valid URL:
"https://dialogflow.googleapis.com/v2/projects/**<project\_id>**/agent/environments/DEV/**users/-**/sessions/<session\_id>:detectIntent"