Questions tagged [self-host-webapi]

Questions regarding Self-Host ASP.NET Web API

71 questions
0
votes
0 answers

how to force camelCase response?

I am attempting to force a camelCase response with the following line in my ConfigureApp method: config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); The entire method: …
Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062
0
votes
1 answer

HttpSelfHostServer use prefixes like HttpListener

There is Prefixes field in HttpListener. You can add some string like "http://+:8080/" and your application just process all queries to 8080 port. I have HttpSelfHostServer it can use only valid Uri string like input to it HttpSelfHostConfiguration…
murzagurskiy
  • 1,273
  • 1
  • 20
  • 44
0
votes
0 answers

Httpselfhostserver not binding any BaseAddress

I use HttpSelfHostServer and I want to bind it on unique specified prefix. public StatServer(string prefix) { if (string.IsNullOrEmpty(prefix)) { Console.WriteLine("Can't use empty prefix"); return; } var…
murzagurskiy
  • 1,273
  • 1
  • 20
  • 44
0
votes
1 answer

OWIN Self-Host + Web Api connection cant make requests through Postman

I am trying to self-host Web API. It works fine when I call requests through my program, where is API controller. But i can't make request through Postman Client. What could be the problem? Api Controller public class MyApiController :…
MikeSFive
  • 3
  • 3
0
votes
0 answers

WEB API Self Hosting in Server

i have created ASP.net WEB API and hosted using OWIN and windows service, i have hosted the service in windows Server 2014 r2 using INSTALLUTILL , The service is running properly. My problem is when ever i browse the API using…
Naveen Kumar
  • 81
  • 2
  • 10
0
votes
1 answer

Team city with WebApi self hosted - WebException an unexpected error occurred on a send

I have WebApi and a c# client application. In order to run integration tests, I use owin self host in a base class like this: Namespace IntegrationTest { [SetUpFixture] Public Class ServerManager { Privet Static IDisposable server; …
T.M Lif
  • 3
  • 3
0
votes
2 answers

Owin selfhost asp.net Web api refuse connection when started as a service

I have a working web api service that I start with a console project. Now I want to have it running as a service. Im installing it as a service using installutil.exe with this code: [RunInstaller(true)] public class…
Erik83
  • 539
  • 3
  • 5
  • 19
0
votes
0 answers

Can I Pass an reference to a Controller in the ASP.net WEB API 4.0

I have a Self Host ASP.net WEB API v.4.0.20710.0, that is a legacy package which I got via NuGet. So my question is if it is possible to get an reference of my logging class to a controller, because they seem to get instanciated somewhere in…
Marv
  • 119
  • 3
  • 14
0
votes
2 answers

Returning a HttpWebResponse from a Server Application (REST)

Im tring to set the values of the HttpWebResponse that is returned by the Controller but I can't create an HttpWebResponse object. Right now I just want to set the status code but maybe I'll need other parts of the HttpWebResponseclass soon too.…
Marv
  • 119
  • 3
  • 14
0
votes
1 answer

Json output with selfhost c# and read response with javascript

i create a simple selfhost with c#, where: public JObject Get() { jsonOut = @"{""server"": ""10.0.0.1"" }"; return JObject.parse(jsonOut); } When i try to open a url http://localhost:2000/api/test into web browser, correctly…
-1
votes
1 answer

C# - every time SSL cert is reissued it requires to change serial number in application

I am using the below code to configure SSL cert in C# web API. The issue is I am finding the SSL cert using the serial number and every time when the SSL cert is reissued by Infra I have to update the cert serial number in the application config. Is…
1 2 3 4
5