asp.net-web-api

How to consume WebAp2 without any authentication in C#

£可爱£侵袭症+ 提交于 2019-12-25 07:31:44
问题 Dearl All I am new to WebAPI2. I want to consume data from a function in JSON format but throwing error StatusCode: 403, ReasonPhrase: 'ModSecurity Action' . I can consume directly from browser but can not from HttpClient. No security implemented. Working perfect on local server but above error throws on remote shared server. APIURL. http://api.owncircles.com/api/Circles/Education/Questions/getAns/2012460157 API Function Code. [HttpGet()] [AllowAnonymous] [Route("~/api/Circles/Education

ASP.NET Web API - Ajax PUT - 405 Method Not Allowed (Entity Framework)

夙愿已清 提交于 2019-12-25 07:24:41
问题 I am trying to PUT an update to a user using JSON to ASP.NET Web API via JQuery's Ajax function. I keep getting a 405 (Method not Allowed) response from the server. I have tried just about everything, including disabling the WebDAV module in web.config and adding Access-Control-Allow-Origin headers to my web.config as well. I used the database-first approach using ADO Model and DbContext generation. The controllers were also generated by ASP.NET upon creation. I assume they should work. I

Viewing which params were requested during load test

依然范特西╮ 提交于 2019-12-25 07:14:51
问题 I'm using Visual Studio Online Load Testing to test an API with variable parameters coming from a CSV file. My setup looks like this: In properties I set "Show Separate Request Results" to True, hoping that I would be able to see which parameters were used during the test, but I cannot find anything on this in the report? Is this the way to do this or am I doing something wrong? 回答1: Visual Studio load tests are not great at showing how individual test cases worked. The test case logs show

Web API - debugging shows confusing information

巧了我就是萌 提交于 2019-12-25 07:06:29
问题 I've already got help here and here with my Web API, but now I think I've arrived to the edge of a Grand Canyon... Fortunately my execution by my boss was postponed, but sentence was not yet commuted. So any suggestions appreciated wholeheartedly, especially since my newbie status in the stuff hasn't yet changed. So, the code is as shown in second linked question (can post it here, but I think it would be redundant). I've corrected errors with SQL link, so it now doesn't crash when trying to

Long running jQuery Ajax call

纵饮孤独 提交于 2019-12-25 07:02:08
问题 I have jQuery AJAX call which request for summary count from WEB API Services. The WEB API process the request and calls a stored procedure (sql server) passing the request parameters. The stored procedure takes longer time (more than 10 minutes to process the request. If the Stored Procedure takes more than 10 minutes the jQuery AJAX call is reporting an unknown error with status code 12002 or 12152(these errors relates to connectivity issue) but the Web Server receives the result back from

How to perform load testing using visual studio [ 2015 Enterprise ]

百般思念 提交于 2019-12-25 06:59:24
问题 First of all i am new to testing. I want to perform load testing on web api's [ around 70 ]. I am using VS2015 Enterprise that comes with load testing feature but i am not aware how to use. Steps that i want to perform are: 1) Response time of the service when running a single request. 2) Memory consumption used by the service when running a single request. 3) Maximum number of concurrent requests supported by the service 4) Memory consumption used by the service when running the maximum

Problems implementing a simple ASP.NET Core Web API Service (PersonExample)

岁酱吖の 提交于 2019-12-25 06:45:22
问题 I am new to ASP.Net, ASP.NET MVC and EntityFrameWork (generally) and with the .NET Core variants (specifically). Currently I am trying to get my first example/test project running (in Visuals Studio 2015) but having a couple of problems I couldn't find solutions for on Google. Part of the tutorials & instructions I followed so far: https://dzone.com/articles/how-to-create-rest-apiweb-api-with-aspnet-core-10 (for the first introduction) http://www.restapitutorial.com/lessons/httpmethods.html

Posting and receiving json with MVC Web API

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 06:37:37
问题 I have seen similar case to mine answered but I have specific need that always differed from others problem. I am sending json data from my html page to the MVC Web API. Unfortunately the data I am receiving is ALWAYS null (I have tried a lot of different things here). The thing is I really need to received the data as json (string), because my data is very complex and cannot be simply deserialized by the Web API (I have my own custom deserializer that does it). Heres the code! First, the web

Easiest way to implement PUT API method to update entity

吃可爱长大的小学妹 提交于 2019-12-25 06:37:25
问题 I have a Web Api project and currently updating an entity is done via POST. Creating an entity is also done via the same POST method, and I implement by checking if the user has sent me an entity Id and then implementing an update as opposed to a create. This is bad good for a number of obvious reasons. It's also confusing from a client perspective and makes the whole method slow and hard to define. So I'm splitting updating into a PUT method, and I want it to be like so (psuedo code) public

how to get data of php Web api json from server to using angularJs.?

旧巷老猫 提交于 2019-12-25 06:29:21
问题 When i am save this json in my local computer and use it in my angularjs script. It's work fine. But when i am using direct server to this it is not working why.? What are missing in my script.? my Json File > http://deals.ownaroof.com/api/webservices/locations_list.json Html > <div ng-controller='prefferedCtrl'>{{locations}}</div> Script > (function(){ angular.module('myapp',['ngRoute']) //afactory to consume webservices and return data to controllers. .service('webServices',['$http'