Skip to content

[FAQ] curl -i prompts for Uri in Windows PowerShell #433

Description

@ThAu-Tr

Course

ai-dev-tools-zoomcamp

Question

Why does curl -i http://localhost:8000/api/orders/standard-1002 prompt me to supply a Uri instead of making the request?

Answer

In Windows PowerShell 5.1, curl is an alias for PowerShell’s Invoke-WebRequest, not the real curl program. Therefore its flags, including -i, do not work like they do on Linux or macOS.

Call the curl executable explicitly:

curl.exe -i http://localhost:8000/api/orders/standard-1002

-i tells curl to include the HTTP response headers in the output.

Alternatively, use PowerShell’s own command explicitly:

Invoke-WebRequest -Uri http://localhost:8000/api/orders/standard-1002

On PowerShell 7 and later, curl is no longer this alias. Microsoft’s Windows curl documentation

Checklist

  • I have searched existing FAQs and this question is not already answered
  • The answer provides accurate, helpful information
  • I have included any relevant code examples or links

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions