# POST Request

Test Soracom Beam with an HTTP POST request using Unified Endpoint.

Use [Unified Endpoint](https://docs.soracom.io/en/services/unified-endpoint), Beam's [HTTP entry point](https://docs.soracom.io/en/services/beam/http), and Soracom's [HTTPS test server](https://docs.soracom.io/en/services/beam/test-servers) to verify how Beam forwards POST requests.

![POST request flow via Unified Endpoint and Beam to HTTPS test server](https://docs.soracom.io/_astro/beam-post._qGxwQgo_UsPdn.webp)

No special setup is required to use Unified Endpoint and the HTTPS test server. In this tutorial, you will add an HTTP entry point configuration and send a POST request from your device.

> [!WARNING]
>
> The device sends POST requests to Unified Endpoint (`http://uni.soracom.io`). The device does not need to know the Beam HTTP entry point URL or the HTTPS test server URL.

## Configuring HTTP Entry Point

Add an HTTP entry point configuration to your SIM group and assign your IoT SIM to the group.

> [!WARNING]
>
> Beam settings are configured at the group level. For more information about groups, see [Groups](https://docs.soracom.io/en/services/groups).

1. In the SIM group settings screen, choose a group, then select **Soracom Beam**.

   For detailed instructions on how to open the SIM Group settings screen, see [Group Settings](https://docs.soracom.io/en/services/groups/settings).

2. Click **+ Add Configuration**▾ and select **HTTP entry point**.

   The Soracom Beam - HTTP configuration screen appears.

3. Configure the following settings:

   | Item | Value |
   | - | - |
   | **Configuration name** | Enter any name. Example: `http over ssl` |
   | **Entry point** > **Path** | Enter `/`. |
   | **Destination** > **Protocol** | Select `HTTPS`. |
   | **Destination** > **Host name** | Enter `beamtest.soracom.io`. |
   | **Destination** > **Port number** | Leave blank. |
   | **Destination** > **Path** | Enter `/`. |
   | **Client Certificate** | Leave off. |
   | **Header manipulations** > **IMSI Header** | Turn on. |
   | **Header manipulations** > **SIM ID Header** | Turn on. |

   For more information about HTTP entry point settings, see [HTTP Entry Point](https://docs.soracom.io/en/services/beam/http).

4. Click **Save**.

5. [Assign your IoT SIM to the group](https://docs.soracom.io/en/services/groups/usage#managing-devices).

   Beam configuration is now complete.

## Sending a POST Request from Your Device

POST requests sent to [Unified Endpoint](https://docs.soracom.io/en/services/unified-endpoint) are forwarded through Unified Endpoint and Beam to the HTTPS test server. The test server processes the HTTP body (payload) and returns a response.

> [!WARNING]
>
> Beam charges are incurred per request. A free tier is available. For more information, see [Soracom Beam Pricing](https://docs.soracom.io/en/pricing#soracom-beam).

1. From a device using an IoT SIM configured with the HTTP entry point, send a POST request to Unified Endpoint (`http://uni.soracom.io`).

   POST request example:

   ```bash
   curl http://uni.soracom.io -d 'Hello from Soracom SIM'
   ```

   Response:

   ```json
   {
     "message": "Hello from Soracom SIM",
     "headers": {
       "X-Soracom-Imsi": "295050012345678",
       "X-Soracom-Sim-Id": "8942310000012345678"
     },
     "log": {
       "preSharedKey": "",
       "stringToSign": "",
       "calculatedSignature": "",
       "providedSignature": "",
       "trails": null
     }
   }
   ```

> [!WARNING]
>
> If the request does not work as expected, check the error logs. For more information, see [Soracom Beam Errors](https://docs.soracom.io/en/services/beam/error-logs).

> [!WARNING]
>
> You can also send POST requests directly to the HTTP entry point (`http://beam.soracom.io:8888`) instead of Unified Endpoint, with the same result.

### Unified Endpoint Benefits

Data sent to Unified Endpoint can also be forwarded to Harvest Data, Funnel, and Funk. This allows you to change destinations from the User Console without modifying your device configuration. For POST requests, using Unified Endpoint is recommended.

### Understanding the Response

The response is generated by the HTTPS test server. The `message` field contains the request body. The `headers` object shows supported Soracom headers that were added by Beam based on the enabled header options in the **Header manipulations** section of your group configuration. In this example, IMSI and SIM ID headers are enabled. The HTTPS test server returns only predefined Soracom headers and does not include custom headers configured in Beam.

## Disabling Beam Configuration

Beam charges are incurred per request. If you are not using Beam, disable the entry point configuration or remove the IoT SIM from the group.

- To stop forwarding requests via Beam, open your SIM group settings and disable or delete the HTTP entry point configuration.
- To remove an IoT SIM from a group, see [Removing a Device from a Group](https://docs.soracom.io/en/services/groups/usage#removing-a-device-from-a-group).
