> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# HttpPost

> Performs a POST request for game:HttpPost(...) or game:HttpPostAsync(...) and returns the response body string or a request error string. The URL must pass Real's URL restrictions.

<div className="real-function-page">
  ```lua theme={null}
  HttpPost(context: DataModel, url: string, body?: string, contentTypeOrCompatibility?: string | number | boolean, headersOrContentType?: table | string, headers?: table): string
  ```

  ## Argümanlar

  <ParamField path={"context"} type={"DataModel"} required>
    Method-call self value. Use game:HttpPost(...) or game:HttpPostAsync(...).
  </ParamField>

  <ParamField path={"url"} type={"string"} required>
    URL string to request.
  </ParamField>

  <ParamField path={"body"} type={"string"}>
    Optional request body. Defaults to an empty string.
  </ParamField>

  <ParamField path={"contentTypeOrCompatibility"} type={"string | number | boolean"}>
    Normally the content type string. A number uses legacy timeout mode, and a boolean uses legacy compression mode.
  </ParamField>

  <ParamField path={"headersOrContentType"} type={"table | string"}>
    Optional headers table in the normal call shape, or optional content type string in legacy mode.
  </ParamField>

  <ParamField path={"headers"} type={"table"}>
    Optional headers table used only in legacy mode. Keys and values must be strings without CR or LF.
  </ParamField>

  ## Dönüşler

  <ResponseField name={"body"} type={"string"}>
    Response body string or request error string.
  </ResponseField>

  ## Örnek

  Run a DataModel-style POST request and return the response body string.

  ```lua theme={null}
  local body = game:HttpPost(
      "https://example.com",
      '{"hello":"world"}',
      "application/json",
      { ["X-Example"] = "Real" }
  )

  print(body)
  ```
</div>
