# Http 요청에서 데이터 타입 바꾸기

**URL:** <https://ask.selectfromuser.com/t/http/507>\
**Category:** 묻고 답하기\
**Tags:** params, http, axios, data-type\
**Created:** [3월 25, 2026, 7:58오전 UTC](https://ask.selectfromuser.com/t/http/507 "2026-03-25T07:58:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hbkim](https://yyz2.discourse-cdn.com/flex032/user_avatar/ask.selectfromuser.com/hbkim/32/23_2.png) [@hbkim](https://ask.selectfromuser.com/u/hbkim)\
**Post date:** [3월 25, 2026, 7:58오전 UTC](https://ask.selectfromuser.com/t/http/507/1 "2026-03-25T07:58:33Z")

</div>

### 질문:

params로 받은 값의 타입은 어떻게 확인하고, API 요청에서 어떻게 사용해야 하나요?

### 답변:

셀렉트에서는 `params` 값은 기본적으로 문자열(String)로 전달되며,

다른 타입을 써야할때는 `axios.data`에서 JavaScript 표현식을 사용해 변환할 수 있습니다.

아래는 HTTP 요청을 보낼 때 `params` 값이 어떻게 전달되는지 확인해볼 수 있는 예제입니다.

```yaml
menus:
- path: pages/type-check
  name: 타입 확인

pages:
- path: pages/type-check
  title: 로컬 서버 타입 확인
  blocks:
  - type: http
    name: echo 호출
    axios:
      method: POST
      url: https://httpbin.selectfromuser.com/anything
      headers:
        Content-Type: application/json
      data:
        "name": "{{name}}"
        "age_string": "{{age}}"
        "age_number": "{{ +age }}"
        "age_number_explicit": "{{ Number(age) }}"
        "age_number_explicit_toString": "{{ String(Number(age)) }}"
        
        "isActive_shorthand": ${{ isActive }}
        "isActive_default_string": "{{ isActive }}"
        "isActive_true_false": "{{ Boolean(isActive) }}"
        "isActive_true_false_other": "{{ isActive == true }}"
        "isActive_true_false_other_other": "{{ !!isActive }}"

        "date_deletedAt": "{{ deletedAt }}"
        "date_deletedAt_full": "{{ deletedAt + ' 00:00:00' }}"
    params:
    - key: name
      label: 이름
      defaultValue: john
    - key: age
      label: 나이
      defaultValue: 30
      format: number
    - key: isActive
      label: 활성여부
      defaultValue: true
      checkbox: true
    - key: deletedAt
      label: 삭제 여부
      defaultValue: '2026-03-25'
      format: date

```

실행후 응답의 `json` 값을 확인해보세요.

```json
"json": {
  "age_number": 30,
  "age_number_explicit": 30,
  "age_number_explicit_toString": "30",
  "age_string": "30",
  "date_deletedAt": "2026-03-25",
  "date_deletedAt_full": "2026-03-25 00:00:00",
  "isActive_default_string": "true",
  "isActive_shorthand": "true",
  "isActive_true_false": true,
  "isActive_true_false_other": true,
  "isActive_true_false_other_other": true,
  "name": "john"
}

```

예제를 실행한 뒤 아래처럼 값을 바꾸고 실행하며 차이를 확인할 수 있습니다.

- `age`를 `30`에서 다른 값으로 바꿔보기
- `isActive` 체크를 해제해보기

추가로 궁금하신점은 댓글로 남겨주시면 안내드리겠습니다.

감사합니다.
