Tutorial by Examples: api

What and Why ? Asp.Net’s Web API2 is the latest version of Web API. It is an easy way to implement a RESTful web service using all of the goodness that the Asp.Net framework provides. Once you understand the basic principles of REST, then a Asp.net Web API2 will be very easy to implement. Web API2...
First, import modules and set connection strings. If you need parameters, you can either put them directly in the URL string (an API in this case) or build them as a dict and pass them to the params argument. import requests import json params = {'id': 'blahblah', 'output': 'json'} # You could ...
Xamarins built in gesture recognizers provide only very basic touch handling. E.g. there is no way to get the position of a touching finger. MR.Gestures is a component which adds 14 different touch handling events. The position of the touching fingers is part of the EventArgs passed to all MR.Gestu...
Image img = new Image(); BitmapImage bitmap = new BitmapImage(new Uri("ms-appx:///Path-to-image-in-solution-directory", UriKind.Absolute)); img.Source = bitmap;
mock-data.ts export class MockData { createDb() { let mock = [ { id: '1', name: 'Object A' }, { id: '2', name: 'Object B' }, { id: '3', name: 'Object C' } ]; let data = [ { id: '1', name: 'Data A' }, ...
The simplest way to wrap and access a piece of state is Agent. The module allows one to spawn a process that keeps an arbitrary data structure and allows one to send messages to read and update that structure. Thanks to this the access to the structure is automatically serialized, as the process onl...
Objective: Use SignalR for notification between Web API, and TypeScript/JavaScript based Web App, where Web API and the Web App is hosted in different domain. Enabling SignalR and CORS on Web API: Create a standard Web API project, and install the following NuGet packages: Microsoft.Owin.Cors ...
This example shows how to take image and display it correctly on the Android device. Firstly we have to create sample application with one button and one imageview. Once user clicks on the button camera is launched and after user selects picture it will be displayed with the proper orientation on ...
SOAP (Simple Access Object Protocol) is XML based, like XML-RPC, is ancestor, with file called WSDL, what describe the method to be exposed. This protocol is often based with SOAP-Enveloppe, a SOAP-Body, and alternatively SOAP-Header, the data is envelopped in a structure and be interpreted as the ...
The Combined Call method allows you to use multiple AlchemyLanguage functions in one request. This example uses a Combined Call to get entities and keywords from the IBM website and returns sentiment information for each result. This example requires AlchemyLanguage service credentials and Node.j...
I have previously written documentation on this site in order to describe how to make web services on Symfony I will write again a tutorial for the symfony >= 3 version. We think that we have a installed web-server on a configured version of Symfony Framework. You must have composer (php packag...
What happens when we execute python -m SimpleHTTPServer 9000? To answer this question we should understand the construct of SimpleHTTPServer (https://hg.python.org/cpython/file/2.7/Lib/SimpleHTTPServer.py) and BaseHTTPServer(https://hg.python.org/cpython/file/2.7/Lib/BaseHTTPServer.py). Firstly, P...
This example shows how to validate forms in Spring MVC using Bean Validation API using Java Annotations, without any xml. User will be proposed to input their registration data and validator will check it for validity. Add Dependencies First of all add the following dependencies in your project: ...
You can technically access the Google Analytics APIs using any programing language that can handle a HTTP Post or HTTP Get request. That being said, Google has also created a number of official standard client libraries to help you with this. Using a standard client library for your chosen programm...
Go through the steps: Add 'NSAppleMusicUsageDescription' to your Info.plist for the privacy authority. Make sure your music is available in your iPhone. It will not work in the simulator. iOS 10.0.1 import UIKit import AVFoundation import MediaPlayer class ViewController: UIViewControll...
POST https://analyticsreporting.googleapis.com/v4/reports:batchGet?access_token={Access token from auth request} { "reportRequests":[ { "viewId":"XXXX", "dateRanges":[ { "startDate":"2015-06-15", &q...
Assuming you have a model that looks like the following, we will get up an running with a simple barebones read-only API driven by Django REST Framework ("DRF"). models.py class FeedItem(models.Model): title = models.CharField(max_length=100, blank=True) url = models.URLField(b...
To separate API logic from the component, we are creating the API client as a separate class. This example class makes a request to Wikipedia API to get random wiki articles. import { Http, Response } from '@angular/http'; import { Injectable } from '@angular/core'; import { Observabl...
public class AmazonRootobject { public Itemsearchresponse ItemSearchResponse { get; set; } } public class Itemsearchresponse { public string xmlns { get; set; } public Operationrequest OperationRequest { get; set; } public Items Items { g...

Page 8 of 12