Questions tagged [webapi2]

127 questions
1
vote
0 answers

Preflight request for specific request is slow, for all browsers

I have one get type of request where options type of preflight request is taking so longer time(almost 40 sec) and in the response I am doing something like response.blob()). I have another request, too, but it works absolute fine. I have…
1
vote
2 answers

Calling angular 4 router with Multiple parameters from C#

I want to call router with multiple parameters using C#.Here is i am making url var _email = UtilityConverter.Encrypt(Email); var _userId = UtilityConverter.Encrypt(Convert.ToString(UserId)); //…
Shamshad Jamal
  • 19
  • 3
  • 17
1
vote
1 answer

crashing when building link using UrlHelper and new uri .net core

I am trying to create a link for pagination using IUrlhelper in .net core in my webapi. I get the error "Value cannot be null.Parameter name: uriString" I have the following code in my start up: services.AddSingleton
developer9969
  • 4,628
  • 6
  • 40
  • 88
1
vote
1 answer

Single sign on to web application with windows login

I have a single sign-off requirement from our customers as part of our next release. The existing flow is as follows: User logs into their organization system (ad user) or main portal system using their email ID or user name as provided by the…
radhey_mishra
  • 137
  • 3
  • 18
1
vote
1 answer

How to read content inside [RoutePrefix("content")]

Is possible to read Route Prefix value in C# web api controller. I tried out, but I couldn't find any way to access this. [RoutePrefix("api/Account")] How to get the value inside "" in to a variable.
Harsha W
  • 3,162
  • 5
  • 43
  • 77
1
vote
0 answers

After upload CSV file and Read the data How to save multiple records from angular4(service.ts) to webapi controller for saving data into db

Note: i have uploaded CSV file by using above code and Read& Validate the data also , but i am unable to save those records into db. can any one can help me to pass data from my service.ts to webpapi controllers action method. Bellow code is html…
1
vote
0 answers

Return value to client has one decimal type value and alway has 6 decimal places

(the project I'm working is C# WebAPI 2 (.net 4.6.2)) in the model of responsing, the class has one field which is decimal type value as average value. And in client the field alway gets 6 decimal places like 123456.000000. I've added a ToString()…
David Smith
  • 893
  • 2
  • 9
  • 19
1
vote
1 answer

Data without using .ToList is also send to api, but how?

In web api the data without using .ToList() is also send to api, but how? This is my LINQ query and I do not use the .ToList() but my data is also sent to the browser.can anyone please tell me the difference or can describe that how it is…
Ali Nafees
  • 67
  • 10
1
vote
1 answer

Handling JWT token in multiple services

I'm working on a system where it access few rest APIs and we use JWT toke based authentication. Is it possible to use same token across all services ? If yes, how
1
vote
2 answers

ASP.NET DefaultBodyModelValidator giving enumerable exception

We use ASP.NET webapi2 and have lot of jsonconverters implemented as part of our models. We rarely get below exception, approx once a month. We don't use any validation attribute on our models. After reviewing there code many times not sure,what is…
Pravin
  • 810
  • 1
  • 10
  • 17
1
vote
0 answers

Web API 2 XML Model Issues

I've been thrown in the deep end a little and just can't figure out how to get the XML to fill out my model correctly. I can get the two strings filling in fine, but as soon as I put in a property of a customer class then it just doesn't get the…
1
vote
0 answers

Web API Dev/Debug mode vs Live Mode Errors are different

This is a real head scratcher for me. I have a Windows Service that posts data to a Web API app. If the Web API on my local development machine is turned off (simulating system down experience for my customer), I get a nice pretty error that looks…
D J
  • 243
  • 1
  • 2
  • 12
1
vote
1 answer

Empty response from CreateStoredProcedureAsync documentdb

So i am calling this method which was in the sample code provided by microsoft for documentdb but i get a null response when trying to create a new stored procedure. private static async Task RunBulkImport(string collectionLink) { …
Melvin
  • 877
  • 3
  • 11
  • 27
1
vote
1 answer

task returned by IHttpActionResult.ExecuteAsync() overload is not run

I'm trying to create a self-hosted Web service that starts its server with Microsoft.Owin.Hosting.WebApp.Start("http://localhost:9000/") and contains a controller derived from System.Net.Http.ApiController. NotifyStartup looks like…
user1877240
1
vote
1 answer

Custom message handler with attribute based routing is not working for Web API 2

I have a Message Handler in my Web API 2 project which change the url to a different path. Such as url "root/controller/somevalue/detials" will be changed to "root/controller/2/details". Where "somevalue" or 2 is a parameter for the action method. I…
Tanjeer
  • 89
  • 4
1 2
3
8 9