All Questions
38 questions
1
vote
1
answer
2k
views
Web API POST not found (throws 404 on browser) but works on PostMan and Swagger
My Web API returns 404 when called from AJAX but works well on PostMan and Swagger.
Post method
// POST api/<controller>
[HttpPost]
public int Post(string url, string RData, string aid, string ...
0
votes
1
answer
160
views
WebAPI return an IQueryable that is like an array is javascript
I have one WebAPI method which returns IQueryable of a 'complex' object written like this:
[Route("api/INV_API/deptSelect")]
public IQueryable<DEPTNAME_DESCR> GetDistinctDeptSelect([FromUri] ...
2
votes
2
answers
170
views
ASP.NET MVC and WebAPI inserting and retriveing records with database table
I am currently using ASP.NET to create a web page.
I have a page at the location: myUrl/INVs/Transaction
From the user point of view: what I am actually doing now is to create a list of items in my ...
9
votes
2
answers
3k
views
How to pass Windows Authentication credential using $.Ajax to Web API service
apologies if the question is dumb, to be honest I myself feel I'm missing something very simple...!
here's the case:
we have a web site (A) which uses windows authentication
the application calls ...
2
votes
3
answers
3k
views
Ajax call to web api is Not Working
I'm new to Ajax,I've written my Api in get method it's return value sucessfully i've seen it on web console and also in fiddler but my ajax call to web api is not get any values at document ready ...
0
votes
1
answer
50
views
Cannot post when parameters exist via AJAX Web API
I'm trying to post to a function via Ajax. When the web api function has no parameters, it works.
When I add parameters it fails.
I suspect the issue is due to routing but I don't see how this can ...
0
votes
2
answers
575
views
Ajax success event doesn't fire in Web Api 2
In my ASP.Net Web Api 2 application I'm using AJAX post to send registration form data to server when submit button was clicked.
function click_form() {
var formData = JSON.stringify({
Name: $('#...
2
votes
2
answers
6k
views
Send blob(s) to ASP.NET Web API
I'm trying to use a component (slim image cropper) to crop images then send both the original image and the cropped version to my server through a Web API. My problem here is that I get the data as a ...
0
votes
2
answers
1k
views
How to add Authorization header in ajax request in extjs
I am trying to upload a file in ExtJS and web API. For that purpose, I need to send an authorization header to the server, but whenever I try to do so I get a null value in the header. I have also ...
1
vote
1
answer
298
views
CORs Request on Web API 2.0
I have enabled CORs on a Web API and on Chrome the GET and POST requests both fail but on the MS Edge browser, the GET request works with no issue but when I try a POST request, it fails with two ...
0
votes
0
answers
3k
views
Download PDF file from Web API using JQuery AJAX
I have a web api method which returns a file. the controller method is as below:
public HttpResponseMessage Get(string id)
{
HttpResponseMessage result = null;
...
2
votes
1
answer
103
views
Passing an object and files to Web Api 2 Controller from ajax Illegal Invocation
I am trying to pass from Ajax a ViewModel object and some files to an aspnet web api 2 controller but throws out an error with TypeError: Illegal invocation, if i remove the extra files object this ...
12
votes
1
answer
6k
views
Access-Control-Allow-Methods doesn't seem to be working
I have a small Web API app up on a web server, with one GET method that returns 3 records, and a POST method that accepts an object and then assigns it an ID and returns the same object.
I'm making ...
1
vote
0
answers
412
views
How I can send request to Web API controller from JavaScript with file and Object.?
Here is my API Method and i want to send request from jQuery to this method.When I send request file does not found in the API.Kindly Help me if iam not on right path.
[Route("NewDocument/{ownerCode}...
0
votes
2
answers
438
views
How to get token from Web API 2 using external login
I have got website and WebAPI 2 ( ASP.NET MVC 5 ) hosted at localhost but with different ports.
I try to get token using this javascript but no token at all and it redirects to the current website ...