簡體   English   中英

如何“確保 HttpRepl 和 Visual Studio Code 之間的正確集成。”?

[英]How "to ensure proper integration between HttpRepl and Visual Studio Code."?

我正在嘗試使用 httprepl 在我的 ASP.NET 應用程序中測試端點。 當我嘗試運行 POST 請求時,我的命令提示符返回:

The default editor must be configured using the command `pref set editor.command.default "{commandLine}"`.

所以我用以下命令設置它:

pref set editor.command.default "C:\Users\User\AppData\Local\Programs\Microsoft VS Code\Code.exe"

然后我收到一個警告:

If your default editor is Visual Studio Code, you should set the default command arguments (`editor.command.default.arguments`) to include `-w` or `--wait` to ensure proper integration between HttpRepl and Visual Studio Code.

我現在不知道該怎么辦。 我試過了:

pref set editor.command.default.arguments "-w"

我不確定這是否有效,但是當我嘗試重復該命令以將 VS Code 設置為我的默認編輯器時,我得到了相同的警告。 我說對了嗎?

我想你可能已經想通了。 但是,由於我遇到了同樣的錯誤(使用 nodejs 和 httprepl 代替),我只是發布我的答案供其他人參考。 對我來說,它與“默認編輯器”無關,我只需要在post之后添加-c "{}"

post -c "{}"

-c 提供了一個(在這種情況下為空)內聯 HTTP 請求正文。 您還可以根據提供一些其他內容,例如: -c "{'id':2,'name':'Cherry'}"

祝你一切順利,度過一個平靜的一天

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM