cURL은 λ¦¬λˆ…μŠ€μ™€ λ§₯ ν„°λ―Έλ„μ—μ„œ HTTP μš”μ²­μ„ μˆ˜ν–‰ν•΄λ³΄κΈ° μœ„ν•΄μ„œ 많이 μ‚¬μš©λœλ‹€. μœˆλ„μš°μ—μ„œλ„ λ§ˆμ΄ν¬λ‘œμ†Œν”„νŠΈμ—μ„œ μ œκ³΅ν•˜λŠ” 컬 ν”„λ‘œκ·Έλž¨μ΄ λ‚΄μž₯λ˜μ–΄μžˆλ‹€. κ·Έλž˜μ„œ λͺ…λ Ή ν”„λ‘¬ν”„νŠΈ(cmd)둜 curl λͺ…λ Ήμ–΄λ₯Ό μˆ˜ν–‰ν•΄λ³΄λ©΄ μ•„λž˜μ™€ 같이 μ •μƒμ μœΌλ‘œ μ‚¬μš©ν•  수 μžˆμŒμ„ μ•Œ 수 μžˆλ‹€. ν•˜μ§€λ§Œ, μœˆλ„μš° ν„°λ―Έλ„μ—μ„œλŠ” λͺ…λ Ή ν”„λ‘¬ν”„νŠΈκ°€ μ•„λ‹ˆλΌ νŒŒμ›Œμ‰˜(Powershll)을 μ‚¬μš©ν•˜κ³  μžˆμœΌλ―€λ‘œ Invoke-WebRequest 으둜 ν˜ΈμΆœλ˜μ–΄ 기본적으둜 μ•Œλ˜ λͺ…λ Ήμ–΄κ°€ μˆ˜ν–‰λ˜μ§€ μ•ŠλŠ”λ‹€.

λͺ…λ Ή ν”„λ‘¬ν”„νŠΈ
C:\Users\Mambo>curl -V curl 8.0.1 (Windows) libcurl/8.0.1 Schannel WinIDN Release-Date: 2023-03-20 Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp Features: AsynchDNS HSTS HTTPS-proxy IDN IPv6 Kerberos Largefile NTLM SPNEGO SSL SSPI threadsafe Unicode UnixSockets
Windows Terminal
PS C:\Users\Mambo> curl cmdlet Invoke-WebRequest(λͺ…λ Ή νŒŒμ΄ν”„λΌμΈ μœ„μΉ˜ 1) λ‹€μŒ 맀개 λ³€μˆ˜μ— λŒ€ν•œ 값을 μ œκ³΅ν•˜μ‹­μ‹œμ˜€. Uri: okky.kr StatusCode : 200 StatusDescription : OK Content : <!DOCTYPE html><html lang="ko" class="js-focus-visible h-full"><head><meta charSet="utf-8"/><title> OKKY - All That Developer</title><meta name="robots" content="index,follow"/><meta name="descriptio n"... RawContent : HTTP/1.1 200 OK Transfer-Encoding: chunked Connection: keep-alive Vary: Accept-Encoding Cache-Control: private, no-cache, no-store, max-age=0, must-revalidate Content-Type: text/html; charset=utf... Forms : {} Headers : {[Transfer-Encoding, chunked], [Connection, keep-alive], [Vary, Accept-Encoding], [Cache-Control, p rivate, no-cache, no-store, max-age=0, must-revalidate]...} Images : {} InputFields : {} Links : {} ParsedHtml : mshtml.HTMLDocumentClass RawContentLength : 22832

cURL의 curl shipped by Microsoft λ¬Έμ„œλ₯Ό 참고해보면 Powershell Alias에 λŒ€ν•œ 문제둜 인해 curl.exe 둜 ν”„λ‘œκ·Έλž¨μ„ μ§€μ •ν•˜μ—¬ λͺ…λ Ήμ–΄λ₯Ό μˆ˜ν–‰ν•˜λ„λ‘ μ•ˆλ‚΄ν•œλ‹€.

PS C:\Users\Mambo> curl.exe -V
curl 8.0.1 (Windows) libcurl/8.0.1 Schannel WinIDN
Release-Date: 2023-03-20
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS HSTS HTTPS-proxy IDN IPv6 Kerberos Largefile NTLM SPNEGO SSL SSPI threadsafe Unicode UnixSockets

νŒŒμ›Œμ‰˜ Alias μ œκ±°ν•˜κΈ°

Remove-Item λͺ…λ Ήμ–΄λ‘œ Aliasλ₯Ό μ œκ±°ν•  수 있으며 λͺ…λ Ήμ–΄λ₯Ό μ‹€ν–‰ν•˜κ³ λ‚˜μ„œ μƒνƒœλ₯Ό μœ μ§€ν•  수 μžˆλ„λ‘ ν˜„μž¬ ν”„λ‘œνŒŒμΌμ„ λ©”λͺ¨μž₯으둜 μ—΄μ–΄ curl에 λŒ€ν•œ Aliasλ₯Ό μ‚­μ œν•  수 μžˆλ„λ‘ μ½”λ“œλ₯Ό μž‘μ„±ν•˜μ—¬ μ €μž₯ν•˜λ„λ‘ ν•˜μž. μ΄μ œλŠ” ꡳ이 curl.exe λΌλŠ” ν”„λ‘œκ·Έλž¨μ„ μ§€μ •ν•΄μ„œ ν˜ΈμΆœν•  ν•„μš”κ°€ 없어진닀.

Windows Terminal
PS C:\Users\Mambo> remove-item alias:\curl PS C:\Users\Mambo> curl -V curl 8.0.1 (Windows) libcurl/8.0.1 Schannel WinIDN Release-Date: 2023-03-20 Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp Features: AsynchDNS HSTS HTTPS-proxy IDN IPv6 Kerberos Largefile NTLM SPNEGO SSL SSPI threadsafe Unicode UnixSockets notepad $profile # λ©”λͺ¨μž₯ 상단에 μž…λ ₯ if (Test-Path -Path alias:curl) { Remove-Item alias:curl }

[팁] λ¦¬λˆ…μŠ€μ—μ„œ cURL λͺ…λ Ήμ–΄ 좜λ ₯이 κ°œν–‰λ˜μ§€ μ•Šμ„ 경우

κ°„ν˜Ή λ¦¬λˆ…μŠ€μ—μ„œ cURL λͺ…λ Ήμ–΄λ₯Ό μˆ˜ν–‰ν•˜λ©΄ 좜λ ₯ κ²°κ³Όκ°€ κ°œν–‰λ˜μ§€ μ•Šμ•„μ„œ λ‹€μŒ λͺ…λ Ήμ–΄λ₯Ό ν˜ΈμΆœν•  λ•Œ λΆˆνŽΈν•¨μ„ λŠλ‚„ 수 μžˆλ‹€. https://stackoverflow.com/a/14614203에 λ‚˜μ™€μžˆλŠ” κ²ƒμ²˜λŸΌ μ‚¬μš©μž 디렉토리에 .curlrc νŒŒμΌμ„ λ§Œλ“€μ–΄μ„œ κ°œν–‰μ΄ λ™μž‘ν•˜λ„λ‘ μž‘μ„±ν•΄λ‘λ©΄ λœλ‹€.

Terminal
vi ~/.curlrc -w "\n"