Tags "asp.net-web-api2" Result

How to access the database from the api controller?

I am doing a mobile app with Angular and MVC. I am doing my app calling some dummy data from the json model in the web api. Check my code below: private IEnumerable<JsonModel> events = new JsonModel[] { new JsonModel {Id = 1, Title = "title1"} new JsonModel {Id = 2, Title = "title2"} }; // GET api/<contr

it1352 0 2020-09-12

Web API 2 and ASP Identity - Handling of locked out users

I just migrated my web app (ASP.NET MVC) to ASP Identity. Everything works fine after quite some work, except the API which the web app provides. This is a WEB API 2, and it is using the bearer token mechanism to authenticate users. The authentication itself also works fine. but: When a user is locked out, the token for the user is still issued vi

it1352 0 2020-09-09

Extend Magento REST API in custom module

I want to use Magento Rest-Api to add custom data into Magento table. I have added one table into Magento db and created module with Rest API for that using following link http://web.archive.org/web/20130512072025/http://magepim.com/news/Extending-the-Magento-REST-API-part-1_13 Now I want to add data into Magento table using Rest API... what I n

it1352 2 2019-05-08

Multiple docker containers as web server on a single IP

I have multiple docker containers on a single machine. On each container is running a process and a web server that provides an API for the process. My question is, how can I access the API from my browser when the default port is 80? To be able to access the web server inside docker container I do the following: sudo docker run -p 80:80 -t -i &l

it1352 0 2019-05-15

Custom Rest Api in Magento

I need rest api to create customer in magneto for that I followed this tutorial http://www.authenticdesign.co.uk/extending-magento-rest-api-v2/ I followed it step by step, But When I test the api on rest client it give me: {"messages":{"error":[{"code":404,"message":"Request does not match any route."}]}} I do not have any idea where I am making

it1352 3 2019-05-08

Asp.NET Web Api - multiple apis/namespaces

In my MVC4 web app, I need to support multiple APIs. I looked around and apparently in Web API, Controllers with same name in different name spaces is not supported. What are my options? Ex: I want to be able to provide to my API consumers links like, http://domainurl/api/api1/Students... http://domainurl/api/api2/Students... A Student Resourc

it1352 0 2020-09-12

Passing on ostringstream

Hi, My c program looks likes this void api1() { cin << info; ostringstream ostr; ostr << info; api2(ostr.str().c_str()); // Getting string from ostreamstream and getting char* from string } void api2(const char* ch) { insert map(ch); } Sample input to api2 "a" after that when i checked the content of map at the end. I am

it1352 0 2019-06-25

Code Path per Flavor in Android Gradle

I have 2 buildTypes (debug, release) and 2 productFlavors (product1, product2). I want to define a buildConfigField for each buildType and productFlavors. The buildConfigField is the url the app to download data from the server, and it changes for each productFlavor and buildTypes. Now, I have: buildTypes { debug { debuggable true

it1352 0 2019-05-19

Aren't promises just callbacks?

I've been developing JavaScript for a few years and I don't understand the fuss about promises at all. It seems like all I do is change: api(function(result){ api2(function(result2){ api3(function(result3){ // do work }); }); }); Which I could use a library like async for anyway, with something like: api().

it1352 0 2019-05-13