Tutorial by Examples: api

Depending on the service, you will either need to use Basic Authentication with a username and password or pass an apikey as a parameter in each request. Some services also support token authentication. GET using Tone Analyzer: curl -X GET \ -u "username":"password" \ -d &qu...
Following example also have explanation required for understanding example within it. import java.time.Clock; import java.time.Duration; import java.time.Instant; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.ZoneId; import java.time...
var express = require("express"), bodyParser = require("body-parser"), server = express(); //body parser for parsing request body server.use(bodyParser.json()); server.use(bodyParser.urlencoded({ extended: true })); //temperary store for `item` in memory var it...
The first part of this example explains how to implement it. In the second, I will explain how it works. This tries to be a general example. The template for the map (see step 3) and the example functions are fully customizable. ################################# IMPLEMENTATION #####################...
If you want to detect when your user enters a specific location, you can create a fence for the specific location with a radius you want and be notified when your user enters or leaves the location. // Your own action filter, like the ones used in the Manifest private static final String FENCE_REC...
\ escapes preserve the following character value, unless the following character is a newline in which case both the \ and the newline are removed. Escaping special characters: $ echo \"quoted text\" "quoted text" $ echo \`\`quoted text\'\' ``quoted text'' $ echo 'single-qu...
For Adding this to project you can find official doc easily but in this example I'm going to highlight some of the key areas to be taken care of. Step 1 :- Add google service dependencies { ... compile 'com.google.android.gms:play-services-appindexing:9.4.0' ... } Step...
Node.js apis can be easily constructed in Express web framework. Following example creates a simple GET api for listing all users. Example var express = require('express'); var app = express(); var users =[{ id: 1, name: "John Doe", age : 23, e...
Following example create POST api using Express. This example is similar to GET example except the use of body-parser that parses the post data and add it to req.body. Example var express = require('express'); var app = express(); // for parsing the body in POST request var bodyParser = require...
using CLI: $ opennlp SentenceDetector ./en-sent.bin < ./input.txt > output.txt using API: import static java.nio.file.Files.readAllBytes; import static java.nio.file.Paths.get; import java.io.IOException; import java.util.Objects; public class FileUtils { /** * Get file data as...
Class for which you will create unit test case. class Authorization { /* Observer so that mock object can work. */ public function attach(Curl $observer) { $this->observers = $observer; } /* Method for which we will create test */ public function postAuthorization($url, $met...
We have a table that includes of countries so we create a model that called countrylist model <?php namespace app\models; use Yii; /** * This is the model class for table "countrylist". * * @property integer $id * @property string $iso * @property string $name * @p...
In this tutorial , I will explain how to integrate Google's BigQuery API with web application. My web application is going to get the data using BigQuery and plot a graph using d3.js and Javascript. Each project on Google Developers Console has a clientID and you need to copy the clientID and put i...
Authentication can be set for an specific APIView endpoint, by using the authentication_classes variable: from rest_framework.authentication import SessionAuthentication, BasicAuthentication from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response ...
This API, sometimes also referred to as "API v3", "YouTube Data API v3" or just "YouTube API", is the most commonly used YouTube API. It enables an application to read, alter, add or delete data related to videos, playlists and channels. This includes, but is not limite...
These APIs are used to query for video and channel analytics, like views/clicks and votes.
Step 1: Install Node.js The build pipeline you will be building is based in Node.js so you must ensure in the first instance that you have this installed. For instructions on how to install Node.js you can checkout the SO docs for that here Step 2: Initialise your project as an node module Open y...
# 1. Login Azure by admin account Add-AzureAccount # # 2. Select subscription name $subscriptionName = Get-AzureSubscription | Select -ExpandProperty SubscriptionName # # 3. Create storage account $storageAccountName = $VMName # here we use VMName to play the storage account name and create...
REpresentational State Transfer (REST) is an architectural style used for web development, introduced and defined in 2000 by Roy Fielding. See it on wiki : REST wiki It's based on HTTP protocol (HTTP on Wiki), HTTP requests (GET, POST, PATCH, DELETE...) / responses codes (404, 400, 200, 201, 500.....
1. Add Unity to your project. If you use NuGet you can use the Unity-package. Run Install-Package Unity in Package Manager Console. This will add the Unity library (and it's dependencies) to your project. 2. Create an implementation of IDependencyResolver. For example: public class UnityResolver...

Page 7 of 12