Questions tagged [webapi2]
127 questions
0
votes
0 answers
asp.net web api2 controller not getting called
I am following msdn tutorials to create a project that has 2 controllers with various routing and http webapi variations.
.Net Framework 4.5.2
IDS: VS Community 2017
I have 2 custom controllers:
Products controller
using System;
using…

Silver
- 1
- 1
0
votes
1 answer
Empty WebApi 2 project throws StackOverflow Exception in VS2017 15.2(26430.12)
I'm Using Visual Studio 2017 15.2(26430.12)
I create a WebApi 2 Empty Project
Then add a controller as the following:
public class DefaultController : ApiController
{
// GET: api/Default
public IEnumerable Get()
{
return…

Mohammad Dayyan
- 21,578
- 41
- 164
- 232
0
votes
1 answer
.net webapi self hosted ssl
I would like to create a self hosted webapi that is reachable over https (ssl). I am a little bit confused because I see many different ways to do this. I read something about Karma and owin. As I know Owin is the current way to do this. Ao I…

Franki1986
- 1,320
- 1
- 15
- 40
0
votes
1 answer
Swagger UI will return API data, but my Authorized calls return "permission denied"
So I believe my APIservice should be fine since I can return results through Swagger? I am calling from a WPF project. I launch the program and it asks me to login, then it continues and will tell me I don't have permission.
I'm super green to…

markokstate
- 923
- 2
- 14
- 28
0
votes
0 answers
How to set up the cookie with browser sync
I am using browser sync and a web api C# 2.0, when I call a method to login it returns in the response headers set-cookie, but the method does not set cookie in the browser.
browserSync.init({
notify: false,
cors: true,
port: 6543,
…

Max Ferreira
- 679
- 1
- 5
- 21
0
votes
3 answers
xml to list conversion in web api c#
I am getting a request in the form of xml which i need converted to list in c# using web api.
Here's the request xml that i receive
…

Melvin
- 877
- 3
- 11
- 27
0
votes
2 answers
TypeError: Cannot read property 'UserName' of undefined with Angular 2
I would like to display a username of the current user in my angular 2 application. The backend is developed with .net core web api.
I write this code but obtain in console this error :
TypeError: Cannot read property 'UserName' of…

Cicciux
- 177
- 4
- 19
0
votes
1 answer
Creating my own external authentication service
I'm trying to find a full tutorial on creating your own extent authentication service. Similar to the ones you see that say "Login with Google" or Facebook or Twitter... How do I create my own version of those? Including allowing creation of…

Steven Yates
- 2,400
- 3
- 30
- 58
0
votes
1 answer
How to limit services to be used from same website
I'm new to azure, and I'm trying to setup a single page website(web api 2). How can I limit access to my services so only my website can use it?
I know that I can use app services to setup my web applications/services but as far as i understand it…

Ashkan S
- 10,464
- 6
- 51
- 80
0
votes
0 answers
optional parameters in web api 2 asp.net core not working
I have a function like below
public CaseController{
[HttpGet(GetAll/{parameter1:maxlength(50)?}/{parameter2:maxlength(50)?}/{parameter3:maxlength(50)?})
public IEnumerable GetAll(string parameter1 = null,string parameter2 =…

S_developer
- 252
- 5
- 18
0
votes
1 answer
Autofac load dependencies from referenced and non referenced assemblies
I have seen many question that ask how to load all referenced assemblies even if not directly used, but I would like to take that a step further. I am building a service and interface that can be extended, the intention is that I could extend the…

Neil Stevens
- 3,534
- 6
- 42
- 71
0
votes
1 answer
Serialize form data for Web Api put request MVC 5
I have a strongly-typed Razor View that shows a record for a class. This view displays a form that the user can use to update the record (a dropdown, a few checkboxes, and a few textboxes). When the user modifies a field by changing the value of a…

Keith Harris
- 1,118
- 3
- 13
- 25
0
votes
1 answer
Why is JQuery AJAX intermittently returning error 0?
I developed a page that POSTs a form with an image to a WebAPI2 controller via AJAX.
I do this repeatedly; I let the user select a bunch of images, they add to a select box, then user can then add more from another location or they can remove items…

nebulous
- 630
- 1
- 6
- 9
0
votes
0 answers
Sending the container name from webapi2 to worker role - azure
I am trying to create Container based on the user-id and within one container I want to upload 5 blobs as text files. The client side is Windows app (UWP).
The user-id and text files are sent to a post request (webapi2) and from here container is…

Dhvani Shah
- 351
- 1
- 7
- 17
0
votes
0 answers
How to upload file from Web Api 2 to Azure Blob Storage using MultipartMemoryStreamProvider
I am trying to send data [User ID, File] from UWP to WebAPI2. From WebApi2, I want to create a container in Azure Storage [container name = user ID]. The code is as follows. The first part is the client side [UWP].
foreach (StorageFile file in…

crakx freeman
- 11
- 2