
--destination 옵션은 curl 명령어에서 URL을 지정할 때 사용하는 옵션입니다.
이 옵션은 URL의 경로를 지정하는 역할을 하며, URL의 호스트, 프로토콜, 파라미터 등은 지정하지 않습니다.
예를 들어, 다음 명령어는 URL의 경로만 지정합니다.
#hostingforum.kr
bash
curl -X POST
http://localhost:3000/api/users
-H 'Content-Type: application/json'
-d '{"name": "John Doe", "email": "john.doe@example.com"}'
이 명령어는 URL의 호스트, 프로토콜, 파라미터 등이 지정되지 않았습니다.
--destination 옵션을 사용하면 URL의 경로만 지정할 수 있습니다.
#hostingforum.kr
bash
curl -X POST
--destination http://localhost:3000/api/users
-H 'Content-Type: application/json'
-d '{"name": "John Doe", "email": "john.doe@example.com"}'
이 명령어는 URL의 경로만 지정했으며, 호스트, 프로토콜, 파라미터 등은 지정되지 않았습니다.
--destination 옵션을 사용할 때는, URL의 경로만 지정할 때 사용합니다. 예를 들어, URL의 호스트, 프로토콜, 파라미터 등이 이미 지정된 경우에는 --destination 옵션을 사용할 필요가 없습니다.
예를 들어, 다음 명령어는 URL의 호스트, 프로토콜, 파라미터 등이 이미 지정되어 있습니다.
#hostingforum.kr
bash
curl -X POST
http://localhost:3000/api/users/path
-H 'Content-Type: application/json'
-d '{"name": "John Doe", "email": "john.doe@example.com"}'
이 명령어는 URL의 경로가 이미 지정되어 있기 때문에 --destination 옵션을 사용할 필요가 없습니다.
2025-04-25 02:26