Mono mod asp server web api post method not working - c#

I am trying to configure mono mod asp server for webapi. It's working fine with get method but Post method gives me strange error.
What I did is I simply created webapi default application and used its default apicontroller without any modification.
Get and Post api is working fine on IIS server. Tried to find the solution but got stuck very bad.
Please help me out.

Related

Angular and Asp.Net WebAPI doesnt Communicate over local network

My Asp.Net WebAPI running at 192.168.1.34:454546 and Angular running at 192.168.1.34:4200
when I run Angular on my pc(192.168.1.34) app works well but when i switch to another pc(for example:192.168.1.35) i can access to individuall both asp.Net WebAPI and Angular. But on page i cant see any Api data.
How can i solve this?
by the way I use Conveyor by Keyoti
The problem was my ISS service. I just enabled it from windows features. and it worked fine

When Web API is called from same project is working fine. But when I call same API from another project in same machine, it is giving 405 method

First time when I created Web API project(MVC pattern) and I created few API controllers and called from html page(Ajax call),I am able to call all APIs and get the data.
But second time I've created two separate solutions one is asp.net Web API and another is MVC Web application.
Now I'm running both the projects in my machine and trying to call web APIs from MVC application, it's coming 405 method not allowed client side error.
Can anyone help me with this scenario.
Anything extra I need to configure in my server Web API to be called from different application?

IIS Express- C# Angular 2 Web Api functionality changes after publish

I have recently published my C# .net core Angular 2 web application to an IIS Server. However, the Web Api that I am calling is not working correctly. When I call the Api, a file is supposed to download however, the file does not render correctly.
I am sure that the api is being called as I am not getting a 404 error. When I run the project on my localhost, it works fine, but on the live site it is not working.
One more thing, when I enter information that should normally cause an error in the web api, it is not throwing me an error like it does in the localhost. It is as if the api is failing but when it is published to IIS it doesn't recognize the error in the angular observable. If anyone has any ideas on why this is happening or how I can debug this it would be appreciated. Thanks
Please run the WebApi from IIS individually and check the error.
Please check the file size while downloading because you need to
configure in webconfig file, if exceed default configuration.
Please check in Angular you have subscribe to that observable.
If you can give more details on this. It can help us to provide
more information like specific error and so on.....

Unable to call local Web API

I'm new to using Visual Studio to run a web api. I have an MVC Web API which I am trying to call locally but keep getting a 404. I am sure the API works fine because a friend of mine has hosted it on another server and I can call it fine. However, I am not sure how to get it running locally. Will building the code automatically get it hosted?
I am trying to call:
https://localhost/MyAPI/Action
Action is one of the action methods in a controller that should return "hello" but I get a 404 when trying to call the API. Any idea what I'm doing wrong here?

How to initialize SPA app with backing Web API

I currently have an Aurelia single page application I'm developing in WebStorm, and a backing Web API I'm developing in Visual Studio. In the dev environment, everything works fine, I just host my client application using WebStorm's server and point it towards my local web api url.
When I deploy the application, I need a way to initiate my client, however. Is it common practice to have my Web API's default route return my index.html page? For some reason it seems very strange to me. Is there a better way to first serve up my index.html? I haven't been able to find much online regarding the subject.
Thanks for any guidance.
What I've done in several projects is to build a single MVC + WebApi project.
This way you will be able to serve both the MVC part for your "index.html" and the WebApi for all your API needs.
So the MVC part is basically just a DefaultController with a Index method that returns the View that initializes my SPA.
In other words, the View for the Index method returns the content you normally would have put in your index.html file.

Categories