9 questions
0
votes
1
answer
180
views
Visual Studio .http file returns 401 even though Authorization header is set for the request
I trying to consume a .NET Core Minimal Api endpoint, which is secured with Bearer tokens, via the .http client in Visual Studio.
I'm setting a valid Authorization: Bearer <token> in the request ...
0
votes
1
answer
182
views
How to store secure variable values in .http files in Visual Studio?
I need to store a username and password in my .http file in Visual Studio in a secure and easy way so that it is not checked into source control accidentally.
@MyAuth.Auth_HostAddress = http://...
1
vote
0
answers
41
views
.http file throwing SSL connection could not be established
I have created a my first http file called app.http
GET https://localhost/FooBar
When I click on the "Send" on the codelens above the "GET" I am thrown
The SSL connection could ...
1
vote
1
answer
167
views
Why am I getting an error trying to upload a file to a REST endpoint using .http files in Visual Studio 2022
I have the following code in a .http file.
@fileName = C:/MyFile.txt
POST {{baseUrl}}/api/endpoint
Authorization: Bearer {{adminToken}}
Content-Type: multipart/form-data; boundary=MyFormBoundary
--...
0
votes
1
answer
357
views
Loading ".http" test file in Visual Studio. This triggers an error in the VS 2022 Output Box
I am trying to run a test file for my Web APIs using .http files.
However, whenever I attempt to load the file in Visual Studio 2022 in the output box I get the following:
Executing command 'dotnet ...
2
votes
0
answers
338
views
How to include authentication headers in visual studio .http file?
I'm trying to connect to MongoDB Ops Manager programmatically, and so I have a public and private key that I generated. When I use the key details and make a request through insomnia using digest ...
0
votes
1
answer
173
views
Visual Studio 2022 httpfile localDatetime is sending UTC time
I am building a web API that should be able to receive POST requests containing user messages. I have a .http file that should send a request to test this interface. One of the fields that it should ...
5
votes
0
answers
796
views
Update environment variable based on response body in .http file (vscode and rest-client)
I want to override the local.token value in settings.json.
I can read the body and update a local variable but this means I need to run the token request and manually update the environment variable ...
1
vote
1
answer
107
views
How to use websockets in Visual Studio http files
I am looking to test websocket connections using Visual Studio 2022 http files. Could not find any documentation on https://learn.microsoft.com/en-us/aspnet/core/test/http-files?view=aspnetcore-8.0.