500 Error Web API IIS
in my IIS local and hosted in aws got this error when I publish my web API app got this errorasp.net
View ArticleSocketException: No connection could be made because the target machine...
When I execute the following code to get the token, I got the error "SocketException: No connection could be made because the target machine actively refused (ipaddress)". What caused the error? Did I...
View ArticleCreate Unauthorized HttpResponseMessage for Custom Authorization attribute...
Hello,I have created custom authorization attribute with claim based. [RoutePrefix("api/Orders")] public class OrdersController : ApiController { [CustomAuthorizeAPI(ClaimType = "module", ClaimValue =...
View ArticleCan't get service to return XML
I can't seem to get my service to return XML. I keep getting a 406 error. It seems so simple and all of the articles I've read make it look easy. For me, however, it simply does not work. What am I...
View Article"Message": "The requested resource does not support http method 'PUT'."
//PUT:api/GetUsers/id [HttpPut] public void EditUser (int id, User user) { if (!ModelState.IsValid) { throw new...
View ArticleReadonly property not returning in xml
I have an Address class with the standard Address1, Address2, City, State, Zip5, Zip4 properties. I also have property with a getter only that combines the city/state/zip. It looks like...
View ArticleWhere Web API token stored(client or server side)?
Hello How are you today? I am going to develop WEB API by using bearer token. My question is this: I send my login details to web API from client side, and then web API send token to client. It's...
View ArticleJSON Deserializing fails: Newtonsoft.Json.JsonReaderException: 'Unexpected...
Whenever I’m running a DeserializeObject command to convert JSON to C# object, I’m getting the JsonReaderException, and the process stops at this line in my JSON:\"emails\":...
View ArticleHow can I update claims?
Hello How are you today? I have a Web API project which using token based authentication.I already make some claims for user authorization.public override async Task...
View Articlecreate audio stream API
hello ,I want to create stream API for .mp3 track. so that i can use(soundmanger2 player with stream) found that sound cloud does("https://api.soundcloud.com/tracks/173676777/stream")is there any...
View ArticleWhy we need to enable CORS at web API level
CORS is browser issue and browser prevent send request to different domain. suppose i have developed one web service project and one mvc project. the jquery in mvc project will call action in web...
View ArticleHow to create a url string to use in browser address bar
Hello,I'm trying to figure out how to create a url to manually test an API. I'm talking about a string of characters that I can enter into my browsers address bar and when I press enter, it processes...
View ArticlePassing base64 string to web api
Hi guys!I'm trying to upload image from client to server.The image in base64 string works in client side, because it is displayed correctly into an image viewer.Then, when I try to upload the image the...
View ArticleBasic authentication and Authorization header data
here a sample code added for basic authpublic class BasicAuthenticationAttribute : AuthorizationFilterAttribute { public override void OnAuthorization(System.Web.Http.Controllers.HttpActionContext...
View ArticleWhat is the meaning of grant_type: 'password'
i found the code from https://forums.asp.net/t/2104737.aspx?Getting+Owin+Authorization+token+with+AJAXhttps://docs.microsoft.com/en-us/aspnet/web-api/overview/security/individual-accounts-in-web-apivar...
View ArticleWeb api CORS enable
Origins Here, we need to set Origins which means from which domain the requests will accept. If you have more than one domain, then you can set as comma separated. Additionally if you want any domain...
View ArticleWCF Service return Json by UriTemplate
I write a wcf service(.net framework 4.6.1) by Visual Studio 2017 community. I want to return a json string in the function GetUserTable. So I add the UriTemplate to pass the userID.But I use the...
View ArticleHow do I return Json String in Web API Project
I always get {} string of yourJson. I had the line GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear();into Application_Start function, but I still get {} json string...
View ArticleAccept and Content-Type attribute is mandatory when we would call web api by...
see the codevar loginData ={ grant_type:'password', username:self.loginEmail(), password:self.loginPassword()};$.ajax({ type:'POST', url:'/Token', headers:{"Accept":"application/json"},...
View ArticleHow to work with access and refresh token with default web api template
i am using VS2013 to develop web api project. i need to know when we select web api template then we got some code but tell me what to add there to get access token?when web api generate access token...
View Article