Tutorial by Examples: api

public function facebook() { return $this->socialite->driver('facebook')->stateless()->redirect()->getTargetUrl(); } This will return the URL that the consumer of the API must provide to the end user to get authorization from Facebook.
Swift textField.autocapitalizationType = .None Objective-C textField.autocapitalizationType = UITextAutocapitalizationTypeNone; All options: .None \ UITextAutocapitalizationTypeNone : Don't autocapitalize anything .Words \ UITextAutocapitalizationTypeWords : Autocapitalize every word .S...
Use pinvoke.net. Before declaring an extern Windows API function in your code, consider looking for it on pinvoke.net. They most likely already have a suitable declaration with all supporting types and good examples.
This example assumes you know how to test a Flask app using pytest Below is an API that takes a JSON input with integer values a and b e.g. {"a": 1, "b": 2}, adds them up and returns sum a + b in a JSON response e.g. {"sum": 3}. # hello_add.py from flask import Flask...
Flask has a utility called jsonify() that makes it more convenient to return JSON responses from flask import Flask, jsonify app = Flask(__name__) @app.route('/api/get-json') def hello(): return jsonify(hello='world') # Returns HTTP Response with {"hello": "world"} ...
Example Using Activity w/ LocationRequest /* * This example is useful if you only want to receive updates in this * activity only, and have no use for location anywhere else. */ public class LocationActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks, ...
The numpy.reshape (same as numpy.ndarray.reshape) method returns an array of the same total size, but in a new shape: print(np.arange(10).reshape((2, 5))) # [[0 1 2 3 4] # [5 6 7 8 9]] It returns a new array, and doesn't operate in place: a = np.arange(12) a.reshape((3, 4)) print(a) # ...
You can use the filter property to retrieve a subset of values from CRM. In this example only the accounts where the company name equals CompanyName are returned. $.ajax({ url: Xrm.Page.context.getClientUrl() + '/api/data/v8.0/accounts?$filter=name eq CompanyName', headers: { 'A...
This program uses the Windows API (WinAPI) to print "Hello World" into a message box. To include a dependency (like Windows in this case), add the uses block including a comma-separated list of units ending with an semicolon. program HelloWorld; uses Windows; begin MessageBox...
With ASP.NET Core 1.0, the MVC and Web API framework have been merged into one framework called ASP.NET Core MVC. This is a good thing, since MVC and Web API share a lot of functionality, yet there always were subtle differences and code duplication. However, merging these two into framework one ...
The following terms describe different ways to case identifiers. Pascal Casing The first letter in the identifier and the first letter of each subsequent concatenated word are capitalized. You can use Pascal case for identifiers of three or more characters. For example: BackColor Camel Casing Th...
It should be noted that Fetch does not support progress callbacks. See: https://github.com/github/fetch/issues/89. The alternative is to use XMLHttpRequest https://developer.mozilla.org/en-US/docs/Web/Events/progress. fetch('https://mywebsite.com/mydata.json').then(json => console.log(json)); ...
string outsidetext = "I am outside of bracket"; string.Format("{{I am in brackets!}} {0}", outsidetext); //Outputs "{I am in brackets!} I am outside of bracket"
An iterator to the first element in the container. If a map object is const-qualified, the function returns a const_iterator. Otherwise, it returns an iterator. // Create a map and insert some values std::map<char,int> mymap; mymap['b'] = 100; mymap['a'] = 200; mymap['c'] = 300; // It...
The C-API is the most powerful way to access PostgreSQL and it is surprisingly comfortable. Compilation and linking During compilation, you have to add the PostgreSQL include directory, which can be found with pg_config --includedir, to the include path. You must link with the PostgreSQL client s...
In ASP.NET Web API, a controller is a class that handles HTTP requests. The public methods of the controller are called action methods or simply actions. When the Web API framework receives a request, it routes the request to an action. To determine which action to invoke, the framework uses a rou...
It is a good idea to maintain a web-scraping session to persist the cookies and other parameters. Additionally, it can result into a performance improvement because requests.Session reuses the underlying TCP connection to a host: import requests with requests.Session() as session: # all req...
After creating an IAP in iTunesConnect: In the view controller that you want to buy in import StoreKit and add the relevant delegates class ViewController: UIViewController, SKProductsRequestDelegate, SKPaymentTransactionObserver { declare a variable with the product id from iTunesConnect ...
Redux is the most common state management library used with React-Native. The following example demonstrates how to use the fetch API and dispatch changes to your applications state reducer using redux-thunk. export const fetchRecipes = (action) => { return (dispatch, getState) => { f...
What? : A fully supported and extensible framework for building HTTP based endpoints. In the world of HTML5, mobile devices, and modern development techniques HTTP have become the default option for building rich, scalable services. The ASP.NET Web API provides an easy to use set of default options...

Page 2 of 12