Questions tagged [webapi]

Questions related to web browser's Web APIs specification. Web APIs is a set of numerous different APIs related to programmatically using web browser with your JavaScript code. For example the visual web page rendered is represented as and controlled by Document Object Model (DOM), which itself is a Web API. Or when using console.debug() function to log messages to the browser's console, you are using Console API.

Questions related to web browser's Web APIs specification.

Web APIs is a set of numerous different APIs related to programmatically controlling the functions of a web page that is run in the web browser with JavaScript code.

For example the visual web page rendered is represented as and controlled by Document Object Model (DOM), which itself is a Web API. Or when using console.debug() function to log messages to the browser's console, you are using Console API.

If you are new to Web APIs, you can read: Introduction to web APIs

1984 questions
245
votes
8 answers

How to export specific request to file using postman?

I want to export one specific request from a Postman extension (Chromium) and send it to another developer so that they can import it. How I can do this?
Sild
  • 3,077
  • 3
  • 15
  • 21
89
votes
6 answers

Startup.cs class is missing in .NET 6

I created REST API's in .NET 5 and everything was working perfectly, but recently I moved to .NET 6 and realized that no startup.cs class is present. How do I add the DB Context in .NET 6 since there is no startup.cs?
Hernan Garcia
  • 909
  • 1
  • 3
  • 4
87
votes
2 answers

JavaScript getBoundingClientRect() changes while scrolling

I want to have the exact distance between the Y-coordinate of an element an the Y-value=0, which I consider as the top of the document. myElement.getBoundingClientRect().top; But the value of getBoundingClientRect() seems to change while scrolling.…
enzian
  • 1,607
  • 3
  • 18
  • 19
26
votes
4 answers

How to modify Content-Type in postman

I'm trying to test my logic app API in postman but I'm having an issue with header postman automatically adding Content-Type = multipart/form-data; when I hover on the content-type tab seeing this "use the request body tab to control the value or…
Gaurav Joshi
  • 861
  • 1
  • 11
  • 17
18
votes
8 answers

NET5.0 Blazor WASM CORS client exception

I have a Blazor WASM app and a Web Api to get called by Blzor via HttpClient. Both programs run on the same machine (and also in production environment which should not be to exotic for a small business application!). Calling the Web Api from the…
tomschrot
  • 219
  • 1
  • 2
  • 4
12
votes
3 answers

How to make ASP.NET Core return XML result?

[HttpGet] [HttpPost] public HttpResponseMessage GetXml(string value) { var xml = $"{value}"; return new HttpResponseMessage { Content = new StringContent(xml, Encoding.UTF8, "application/xml") …
narouz
  • 195
  • 1
  • 2
  • 8
11
votes
1 answer

Exclude particular Web Api endpoint from the swagger UI

I'm using Swagger UI with asp.net core web api. For my CRUD operations, I have a base controller class, which defines abstract methods: public class BaseController { [HttpPost, Route("create-single")] public abstract…
Arkadi
  • 1,153
  • 1
  • 14
  • 35
10
votes
1 answer

Unable to resolve service for type 'Microsoft.Extensions.Caching.Memory.IMemoryCache'

I have a WEB API using .NET 6. I used MemoryCache to store data. But when I run the Api I get the following error: Unable to resolve service for type 'Microsoft.Extensions.Caching.Memory.IMemoryCache' myContoroler: public class myContoroler :…
user20528130
10
votes
1 answer

Self-Hosted Web API in .NET 6

I need to add a very simple Web API to an existing library so that Python can communicate with the application. Simple Request/JSON response. This is more challenging than initially thought. I'm used to NodeJS where a library like Express can do…
ceds
  • 2,097
  • 5
  • 32
  • 50
9
votes
3 answers

Using Web Crypto API in NextJS, but getting error 'crypto is not defined'

Can I use web crypto api in NextJS? I tried to use crypto.subtle.digest('SHA-256', data) but getting an error ReferenceError: crypto is not defined
Alex Parij
  • 1,168
  • 1
  • 14
  • 21
9
votes
2 answers

Disable/Enable Button in Blazor - Depending on what is in the form

so I am creating this little project in ASP.NET Core, I've got a WEB API, already written but I am struggling with Frontend in Blazor to consume that API. POST, GET HTTP requests work great. I've got this one razor page in which I put some data in…
Evenix
  • 105
  • 1
  • 1
  • 4
8
votes
4 answers

CORS in .NET 6.0 web api

I have a React app calling a .NET 6 Web API using Axios. In the program.cs file, I have added builder.Services.AddCors and app.UseCors as below. But I still get CORS error and 404 preflight. The method used to works in .NET 5 Web Api. Is there…
Law Hui Sheng
  • 315
  • 1
  • 2
  • 9
8
votes
1 answer

How to pass xml input (request) to Web api on .net core 3.1

I have a .net core 3.1 web api. I have tried the following but it always turns up null when it hits it [HttpPost] public IActionResult ReturnXmlDocument(HttpRequestMessage request) { var doc = new XmlDocument(); …
rahul
  • 232
  • 1
  • 5
  • 13
8
votes
2 answers

Mark a WebApi method's parameter as obsolete / deprecated for Swashbuckle / Swagger

As per my understanding of the Swagger Specification, it's possible to mark a parameter as obsolete: Deprecated Parameters Use deprecated: true to mark a parameter as deprecated. - in: query name: format required: true …
Jonathan L.
  • 682
  • 6
  • 10
7
votes
1 answer

showSaveFilePicker not in Firefox - what can I use instead?

With great surprise I found out that FF does not support window.showSaveFilePicker. What could I use in FF to allow saving a file from the browser programmatically? Maybe can someone explain what reasons has FF for not supporting this feature?
Marco Faustinelli
  • 3,734
  • 5
  • 30
  • 49
1
2 3
99 100