RESTful Examples. RESTful Examples 1 Apache 3 Jersey 5 JAX-RS 7 ApplicationConfig.java 7 HelloGregg.java 8

Size: px
Start display at page:

Download "RESTful Examples. RESTful Examples 1 Apache 3 Jersey 5 JAX-RS 7 ApplicationConfig.java 7 HelloGregg.java 8"

Transcription

1 RESTful Examples RESTful Examples 1 Apache 3 Jersey 5 JAX-RS 7 ApplicationConfig.java 7 HelloGregg.java 8 REST in JavaScript 9 #1) createrequest with XMLHttpRequest 9 #2) Must supply a Callback function onreadystatechange 9 #3) Sending the Request 10 Python/Django 11.user 11.auth 11 Standard HttpRequest attributes 11 Responses 11 Creating Responses 11 Class Based Views 11 Python/Django Example 12 Testing our PYTHON API 12 Or directly through the browser Types of Routers 14 Serialization and Deserialization important parts of Django-rest-framework 14 Requests and Responses 14 Request objects: 14 Issuing GET Requests 14 Issuing POST Requests 14

2 REST in Java Simple REST client in Java 3 methods 1) Apache HttpClient 2) Jersey 3) JAX-RS (Java API for RESTful Web Services)

3 Apache HTTP GET method: import java.io.bufferedreader; import java.io.ioexception; import java.io.inputstreamreader; import org.apache.http.httpresponse; import org.apache.http.client.clientprotocolexception; import org.apache.http.client.httpclient; import org.apache.http.client.methods.httpget; import org.apache.http.impl.client.defaulthttpclient; public class Test { public static void main(string[] args) throws ClientProtocolException, IOException { HttpClient client = new DefaultHttpClient(); HttpGet request = new HttpGet(' HttpResponse response = client.execute(request); BufferedReader rd = new BufferedReader (new InputStreamReader(response.getEntity().getContent())); String line = ''; while ((line = rd.readline())!= null) { System.out.println(line); HTTP POST method; for sending simple string import java.io.bufferedreader; import java.io.ioexception; import java.io.inputstreamreader; import org.apache.http.httpresponse; import org.apache.http.client.clientprotocolexception; import org.apache.http.client.httpclient; import org.apache.http.client.methods.httppost; import org.apache.http.entity.stringentity; import org.apache.http.impl.client.defaulthttpclient; public class Test { public static void main(string[] args) throws ClientProtocolException, IOException { HttpClient client = new DefaultHttpClient(); HttpPost post = new HttpPost(' StringEntity input = new StringEntity('product'); post.setentity(input); HttpResponse response = client.execute(post); BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); String line = ''; while ((line = rd.readline())!= null) { System.out.println(line);

4 For JSON you can use JSONObject to create string representation of JSON. JSONObject json = new JSONObject(); json.put('name', 'value'); json.put('name', 'value'); StringEntity se = new StringEntity( json.tostring()); POST request with multiple parameters: import java.io.bufferedreader; import java.io.ioexception; import java.io.inputstreamreader; import java.util.arraylist; import java.util.list; import org.apache.http.httpresponse; import org.apache.http.client.clientprotocolexception; import org.apache.http.client.httpclient; import org.apache.http.client.entity.urlencodedformentity; import org.apache.http.client.methods.httppost; import org.apache.http.impl.client.defaulthttpclient; import org.apache.http.message.basicnamevaluepair; public class Test { public static void main(string[] args) throws ClientProtocolException, IOException { HttpClient client = new DefaultHttpClient(); HttpPost post = new HttpPost(' List namevaluepairs = new ArrayList(); namevaluepairs.add(new BasicNameValuePair('name', 'value')); //you can as many name value pair as you want in the list. post.setentity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = client.execute(post); BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); String line = ''; while ((line = rd.readline())!= null) { System.out.println(line);

5 Jersey the specification of REST support in Java. Jersey contains basically a REST server and a REST client. i HTTP GET method: import java.io.ioexception; import javax.ws.rs.core.mediatype; import javax.ws.rs.core.uribuilder; import org.apache.http.client.clientprotocolexception; import com.sun.jersey.api.client.client; import com.sun.jersey.api.client.webresource; import com.sun.jersey.api.client.config.clientconfig; import com.sun.jersey.api.client.config.defaultclientconfig; public class Test { public static void main(string[] args) throws ClientProtocolException, IOException { ClientConfig config = new DefaultClientConfig(); Client client = Client.create(config); WebResource service = client.resource(uribuilder.fromuri(' HTTP POST method: // getting XML data System.out.println(service. path('restpath').path('resourcepath'). accept(mediatype.application_json).get(string.class)); // getting JSON data System.out.println(service. path('restpath').path('resourcepath').accept(mediatype.applica TION_XML).get(String.class)); import java.io.ioexception; import javax.ws.rs.core.mediatype; import javax.ws.rs.core.multivaluedmap; import javax.ws.rs.core.uribuilder; import org.apache.http.client.clientprotocolexception; import com.sun.jersey.api.client.client; import com.sun.jersey.api.client.clientresponse; import com.sun.jersey.api.client.webresource; import com.sun.jersey.api.client.config.clientconfig; import com.sun.jersey.api.client.config.defaultclientconfig; import com.sun.jersey.core.util.multivaluedmapimpl; public class Test { public static void main(string[] args) throws ClientProtocolException, IOException { ClientConfig config = new DefaultClientConfig(); Client client = Client.create(config); WebResource webresource = client.resource(uribuilder.fromuri(' MultivaluedMap formdata = new MultivaluedMapImpl(); formdata.add('name', 'val'); formdata.add('name', 'val'); ClientResponse response = webresource.type(mediatype.application_form_urlencoded_type).post(clientresponse.class, formdata); System.out.println('Response ' +

6 response.getentity(string.class)); POST request, Form class submit multiple parameters: import java.io.ioexception; import javax.ws.rs.core.mediatype; import javax.ws.rs.core.uribuilder; import org.apache.http.client.clientprotocolexception; import com.sun.jersey.api.client.client; import com.sun.jersey.api.client.clientresponse; import com.sun.jersey.api.client.webresource; import com.sun.jersey.api.client.config.clientconfig; import com.sun.jersey.api.client.config.defaultclientconfig; import com.sun.jersey.api.representation.form; public class Test { public static void main(string[] args) throws ClientProtocolException, IOException { ClientConfig config = new DefaultClientConfig(); Client client = Client.create(config); WebResource service = client.resource(uribuilder.fromuri(' Form form = new Form(); form.add('name', 'value'); form.add('name', 'value'); ClientResponse response = service.path('restpath').path('resourcepath'). type(mediatype.application_form_urlencoded).post(clientresponse.class, form); System.out.println('Response ' + response.getentity(string.class)); Posted by: Harsh Raval in Enterprise Java September 11th, 2012

7 JAX-RS ApplicationConfig.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools Templates * and open the template in the editor. package hellogregg; import java.util.set; import javax.ws.rs.core.application; /** * public class ApplicationConfig extends Application public Set<Class<?>> getclasses() { Set<Class<?>> resources = new java.util.hashset<>(); addrestresourceclasses(resources); return resources; /** * Do not modify addrestresourceclasses() method. * It is automatically populated with * all resources defined in the project. * If required, comment out calling this method in getclasses(). private void addrestresourceclasses(set<class<?>> resources) { resources.add(hellogregg.hellogregg.class);

8 HelloGregg.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools Templates * and open the template in the editor. package hellogregg; import javax.ws.rs.core.context; import javax.ws.rs.core.uriinfo; import javax.ws.rs.produces; import javax.ws.rs.consumes; import javax.ws.rs.get; import javax.ws.rs.path; import javax.ws.rs.put; import javax.ws.rs.core.mediatype; /** * REST Web Service * public class HelloGregg private UriInfo context; /** * Creates a new instance of HelloGregg public HelloGregg() { /** * Retrieves representation of an instance of hellogregg.hellogregg an instance public String gethtml() { return "<html><body><h1>hello, Gregg!!</h1>RESTful using javax.ws.rs, RESTful Java API</body></html>"; /** * PUT method for updating or creating an instance of HelloGregg content representation for public void puthtml(string content) {

9 REST in JavaScript XMLHttpRequest object allows you to send a request, either GET or POST; client-side (in-browser) JavaScript. AJAX applications are RESTful, every AJAX request is an HTTP request, Creating XMLHttpRequest Objects Create request, create callback function then issue the actual GET or POST #1) createrequest with XMLHttpRequest no standard way to create XMLHttpRequest objects allows you to send a request, either GET or POST. cross-browser solution: Diff for each Browser function () { var result = null; if (window.xmlhttprequest) { // FireFox, Safari, etc. result = new XMLHttpRequest(); if (typeof xmlhttp.overridemimetype!= 'undefined') { result.overridemimetype('text/xml'); // Or anything else else if (window.activexobject) { // MSIE result = new ActiveXObject("Microsoft.XMLHTTP"); else { // No known mechanism -- consider aborting the application return result; #2) Must supply a Callback function onreadystatechange XMLHttpRequest does not immediately return a value. Rather, you have to supply a callback function createrequest that will be invoked when the request completes. Confusingly, you callback is actually invoked several times (up to four times, depending on the browser), during different stages of the client/server interaction. It is only the fourth and final stage that interests us; var req = createrequest(); // defined above // Create the callback: req.onreadystatechange = function() { if (req.readystate!= 4) return; // Not there yet if (req.status!= 200) { // Handle request failure here... return; // Request successful, read the response var resp = req.responsetext; //... and use it as needed by your app. Note that if the response is an XML response (denoted by the server using MIME type text/xml), it can also be read using the responsexml property. This property contains an XML document, and can be used as such using JavaScript's DOM

10 navigation facilities. #3) Sending the Request Once we have created the request object and set up its callback function, it is time to issue the request: req.open("get", url, true); req.send(); For POST requests, use: req.open("post", url, true); req.setrequestheader("content-type", "application/x-www-form-urlencoded"); req.send(form-encoded request body);

11 Authentication Python/Django Use different authentication policies for different parts of your API. Provide both user and token information associated with the incoming request..user request.user typically returns an instance of django.contrib.auth.models.user, although the behavior depends on the authentication policy being used. If the request is unauthenticated the default value of request.user is an instance of django.contrib.auth.models.anonymoususer..auth request.auth returns any additional authentication context.method request.method returns the uppercased string representation of the request's HTTP method. Standard HttpRequest attributes Request extends Django's HttpRequest, all the other standard attributes and methods are also available. For example the request.meta and request.session dictionaries are available as normal. Responses Response class which allows you to return content that can be rendered into multiple content types, depending on the client request. Response class subclasses Django's SimpleTemplateResponse. Response objects are initialised with data, which should consist of native Python primitives. Creating Responses Unlike regular HttpResponse objects, you do not instantiate Response objects with rendered content. Instead you pass in unrendered data, which may consist of any Python primitives. Class Based Views APIView class, which subclasses Django's View class. APIView classes are different from regular View classes in the following ways: Requests passed to the handler methods will be REST framework's Request instances, not Django's HttpRequest instances. Handler methods may return REST framework's Response, instead of Django's HttpResponse. The view will manage content negotiation and setting the correct renderer on the response

12 Python/Django Example from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import authentication, permissions class ListUsers(APIView): """ View to list all users in the system. * Requires token authentication. * Only admin users are able to access this view. """ authentication_classes = (authentication.tokenauthentication,) permission_classes = (permissions.isadminuser,) def get(self, request, format=none): """ Return a list of all users. """ usernames = [user.username for user in User.objects.all()] return Response(usernames) Testing our PYTHON API We're now ready to test the API we've built. Let's fire up the server from the command line. python./manage.py runserver We can now access our API, both from the command-line, using tools like curl... bash: curl -H 'Accept: application/json; indent=4' -u admin:password { "count": 2, "next": null, "previous": null, "results": [ { " ": "admin@example.com", "groups": [], "url": " "username": "admin", { " ": "tom@example.com", "groups": [ ], "url": " "username": "tom" ] Or using the httpie, command line tool... bash: http -a username:password HTTP/ OK... { "count": 2, "next": null, "previous": null, "results": [ { " ": "admin@example.com",

13 ] "groups": [], "url": " "username": "paul", { " ": "tom@example.com", "groups": [ ], "url": " "username": "tom" Or directly through the browser...

14 Django REST framework (DRF) - REST adds support for auto URL routing to Django Types of Routers Simple Default Custom Serialization and Deserialization important parts of Django-rest-framework 1. Serializing data with JSONRenderer: process of making a streamable representation A JSONRenderer converts the request data into JSON using utf-8 encoding. Normally we use this when we want our data to be streamable. >>> data {'cal_id': u'2', 'username': u'tester' >>> content = JSONRenderer().render(data) >>> content '{"cal_id": "2", "username": "tester"' 2. Deserializing data with JSONParser: A JSONParser parses the JSON request content. building an API we render data into JSON format. Firstly, we parse a stream into Python native datatypes with BytesIO >>> content '{"cal_id": "2", "username": "tester"' >>> stream = BytesIO(content) >>> data = JSONParser().parse(stream) >>> data {u'username': u'tester', u'cal_id': u'2' Requests and Responses Request objects: The request object in REST framework has more abilities. request.data in Request object is similar to Request.POST added with the capabilities of handling arbitrary data which works for 'POST', 'PUT' and 'PATCH' methods. request.files, request.query_params, request.parsers, request.stream which will help in dealing with the request a hassle free task. REST in Python Issuing GET Requests The Python module urllib2 makes reading URLs trivial: import urllib2 url = ' response = urllib2.urlopen(url).read() Issuing POST Requests A POST request is just as easy, simply passing (encoded) request data as an extra parameter to urlopen, thus: import urllib import urllib2

15 url = ' params = urllib.urlencode({ 'firstname': 'John', 'lastname': 'Doe' ) response = urllib2.urlopen(url, params).read()

Session 12. RESTful Services. Lecture Objectives

Session 12. RESTful Services. Lecture Objectives Session 12 RESTful Services 1 Lecture Objectives Understand the fundamental concepts of Web services Become familiar with JAX-RS annotations Be able to build a simple Web service 2 10/21/2018 1 Reading

More information

Session 15. RESTful Services Part 3. Lecture Objectives

Session 15. RESTful Services Part 3. Lecture Objectives Session 15 RESTful Services Part 3 1 Lecture Objectives Understand how to pass parameters from the URL to a Web service Understand how to return values from a Web service using the @Produces annotation

More information

Session 11. Ajax. Reading & Reference

Session 11. Ajax. Reading & Reference Session 11 Ajax Reference XMLHttpRequest object Reading & Reference en.wikipedia.org/wiki/xmlhttprequest Specification developer.mozilla.org/en-us/docs/web/api/xmlhttprequest JavaScript (6th Edition) by

More information

A synchronous J avascript A nd X ml

A synchronous J avascript A nd X ml A synchronous J avascript A nd X ml The problem AJAX solves: How to put data from the server onto a web page, without loading a new page or reloading the existing page. Ajax is the concept of combining

More information

Module7: AJAX. Click, wait, and refresh user interaction. Synchronous request/response communication model. Page-driven: Workflow is based on pages

Module7: AJAX. Click, wait, and refresh user interaction. Synchronous request/response communication model. Page-driven: Workflow is based on pages INTERNET & WEB APPLICATION DEVELOPMENT SWE 444 Fall Semester 2008-2009 (081) Module7: Objectives/Outline Objectives Outline Understand the role of Learn how to use in your web applications Rich User Experience

More information

Fall Semester (081) Module7: AJAX

Fall Semester (081) Module7: AJAX INTERNET & WEB APPLICATION DEVELOPMENT SWE 444 Fall Semester 2008-2009 (081) Module7: AJAX Dr. El-Sayed El-Alfy Computer Science Department King Fahd University of Petroleum and Minerals alfy@kfupm.edu.sa

More information

2 Apache Wink Building Blocks

2 Apache Wink Building Blocks 2 Apache Wink Building Blocks Apache Wink Building Block Basics In order to take full advantage of Apache Wink, a basic understanding of the building blocks that comprise it and their functional integration

More information

Session 11. Calling Servlets from Ajax. Lecture Objectives. Understand servlet response formats

Session 11. Calling Servlets from Ajax. Lecture Objectives. Understand servlet response formats Session 11 Calling Servlets from Ajax 1 Lecture Objectives Understand servlet response formats Text Xml Html JSON Understand how to extract data from the XMLHttpRequest object Understand the cross domain

More information

Session 13. RESTful Services Part 2. Lecture Objectives

Session 13. RESTful Services Part 2. Lecture Objectives Session 13 RESTful Services Part 2 1 Lecture Objectives Understand how to pass parameters to a Web services Understand how to return values from a Web service 2 10/31/2018 1 Reading Tutorials Reading &

More information

AJAX Programming Chris Seddon

AJAX Programming Chris Seddon AJAX Programming Chris Seddon seddon-software@keme.co.uk 2000-12 CRS Enterprises Ltd 1 2000-12 CRS Enterprises Ltd 2 What is Ajax? "Asynchronous JavaScript and XML" Originally described in 2005 by Jesse

More information

2/6/2012. Rich Internet Applications. What is Ajax? Defining AJAX. Asynchronous JavaScript and XML Term coined in 2005 by Jesse James Garrett

2/6/2012. Rich Internet Applications. What is Ajax? Defining AJAX. Asynchronous JavaScript and XML Term coined in 2005 by Jesse James Garrett What is Ajax? Asynchronous JavaScript and XML Term coined in 2005 by Jesse James Garrett http://www.adaptivepath.com/ideas/essays/archives /000385.php Ajax isn t really new, and isn t a single technology

More information

Controller/server communication

Controller/server communication Controller/server communication Mendel Rosenblum Controller's role in Model, View, Controller Controller's job to fetch model for the view May have other server communication needs as well (e.g. authentication

More information

Controller/server communication

Controller/server communication Controller/server communication Mendel Rosenblum Controller's role in Model, View, Controller Controller's job to fetch model for the view May have other server communication needs as well (e.g. authentication

More information

Trusted Source SSO. Document version 2.3 Last updated: 30/10/2017.

Trusted Source SSO. Document version 2.3 Last updated: 30/10/2017. Trusted Source SSO Document version 2.3 Last updated: 30/10/2017 www.iamcloud.com TABLE OF CONTENTS 1 INTRODUCTION... 1 2 PREREQUISITES... 2 2.1 Agent... 2 2.2 SPS Client... Error! Bookmark not defined.

More information

Type of Submission: Article Title: Watson Explorer REST API Tutorial #1 Subtitle: Java Programming. Keywords: WEX, WCA, analytics, Watson

Type of Submission: Article Title: Watson Explorer REST API Tutorial #1 Subtitle: Java Programming. Keywords: WEX, WCA, analytics, Watson Type of Submission: Article Title: Watson Explorer REST API Tutorial #1 Subtitle: Java Programming Keywords: WEX, WCA, analytics, Watson Prefix: Mr. Given: Kameron Middle: A. Family: Cole Suffix: Job Title:

More information

Configuring and Using Osmosis Platform

Configuring and Using Osmosis Platform Configuring and Using Osmosis Platform Index 1. Registration 2. Login 3. Device Creation 4. Node Creation 5. Sending Data from REST Client 6. Checking data received 7. Sending Data from Device 8. Define

More information

Developing Applications for the Java EE 7 Platform 9-2

Developing Applications for the Java EE 7 Platform 9-2 Developing Applications for the Java EE 7 Platform 9-2 REST is centered around an abstraction known as a "resource." Any named piece of information can be a resource. A resource is identified by a uniform

More information

Ajax Ajax Ajax = Asynchronous JavaScript and XML Using a set of methods built in to JavaScript to transfer data between the browser and a server in the background Reduces the amount of data that must be

More information

Ajax Ajax Ajax = Asynchronous JavaScript and XML Using a set of methods built in to JavaScript to transfer data between the browser and a server in the background Reduces the amount of data that must be

More information

Using the Jersey JAX-RS Reference Implementation 11g Release 1 (10.3.6)

Using the Jersey JAX-RS Reference Implementation 11g Release 1 (10.3.6) [1]Oracle Fusion Middleware Using the Jersey JAX-RS Reference Implementation 11g Release 1 (10.3.6) E41958-02 April 2015 Documentation for software developers that describes how to use the Jersey JAX-RS

More information

Coding Menggunakan software Eclipse: Mainactivity.java (coding untuk tampilan login): package com.bella.pengontrol_otomatis;

Coding Menggunakan software Eclipse: Mainactivity.java (coding untuk tampilan login): package com.bella.pengontrol_otomatis; Coding Menggunakan software Eclipse: Mainactivity.java (coding untuk tampilan login): package com.bella.pengontrol_otomatis; import android.app.activity; import android.os.bundle; import android.os.countdowntimer;

More information

Developing RESTful Web services with JAX-RS. Sabyasachi Ghosh, Senior Application Engneer Oracle

Developing RESTful Web services with JAX-RS. Sabyasachi Ghosh, Senior Application Engneer Oracle Developing RESTful Web services with JAX-RS Sabyasachi Ghosh, Senior Application Engneer Oracle India, @neilghosh Java API for RESTful Web Services (JAX-RS) Standard annotation-driven API that aims to

More information

Introduction to Ajax

Introduction to Ajax Introduction to Ajax with Bob Cozzi What is AJAX? Asynchronous JavaScript and XML A J a X Asynchronous data retrieval using the XMLHttpRequest object from JavaScript Data is retrieved from the server as

More information

AJAX ASYNCHRONOUS JAVASCRIPT AND XML. Laura Farinetti - DAUIN

AJAX ASYNCHRONOUS JAVASCRIPT AND XML. Laura Farinetti - DAUIN AJAX ASYNCHRONOUS JAVASCRIPT AND XML Laura Farinetti - DAUIN Rich-client asynchronous transactions In 2005, Jesse James Garrett wrote an online article titled Ajax: A New Approach to Web Applications (www.adaptivepath.com/ideas/essays/archives/000

More information

Practice 2. SOAP & REST

Practice 2. SOAP & REST Enterprise System Integration Practice 2. SOAP & REST Prerequisites Practice 1. MySQL and JPA Introduction JAX-WS stands for Java API for XML Web Services. JAX-WS is a technology for building web services

More information

API 2.0 API 2.0 : : : : : JAVA JAVA 2.2 :

API 2.0 API 2.0 : : : : : JAVA JAVA 2.2 : API 2.0 API 2.0 : : : 1. 1.1 : : : JAVA 2. 2.1 : JAVA 2.2 : : JAVA 2.3 JAVA 2.4 JAVA 2.5 JAVA 2.6 JAVA 2.7 JAVA 2.8 () JAVA 2.9 ( or ) JAVA 2.10 ( or ), JAVA 3. 3.1 JAVA (JAVA) : https://api.simboss.com

More information

jmaki Overview Sang Shin Java Technology Architect Sun Microsystems, Inc.

jmaki Overview Sang Shin Java Technology Architect Sun Microsystems, Inc. jmaki Overview Sang Shin Java Technology Architect Sun Microsystems, Inc. sang.shin@sun.com www.javapassion.com Agenda What is and Why jmaki? jmaki widgets Using jmaki widget - List widget What makes up

More information

Composer Help. Web Request Common Block

Composer Help. Web Request Common Block Composer Help Web Request Common Block 7/4/2018 Web Request Common Block Contents 1 Web Request Common Block 1.1 Name Property 1.2 Block Notes Property 1.3 Exceptions Property 1.4 Request Method Property

More information

Domain Name Service. API Reference. Issue 05 Date

Domain Name Service. API Reference. Issue 05 Date Issue 05 Date 2018-08-30 Contents Contents 1 API Invoking Method...1 1.1 Service Usage... 1 1.2 Request Methods... 1 1.3 Request Authentication Methods...2 1.4 Token Authentication...2 1.5 AK/SK Authentication...

More information

Developing a Web Server Platform with SAPI support for AJAX RPC using JSON

Developing a Web Server Platform with SAPI support for AJAX RPC using JSON 94 Developing a Web Server Platform with SAPI support for AJAX RPC using JSON Assist. Iulian ILIE-NEMEDI Informatics in Economy Department, Academy of Economic Studies, Bucharest Writing a custom web server

More information

Mobile Development Lecture 9: Android & RESTFUL Services

Mobile Development Lecture 9: Android & RESTFUL Services Mobile Development Lecture 9: Android & RESTFUL Services Mahmoud El-Gayyar elgayyar@ci.suez.edu.eg Elgayyar.weebly.com What is a RESTFUL Web Service REST stands for REpresentational State Transfer. In

More information

flask-jwt-simple Documentation

flask-jwt-simple Documentation flask-jwt-simple Documentation Release 0.0.3 vimalloc rlam3 Nov 17, 2018 Contents 1 Installation 3 2 Basic Usage 5 3 Changing JWT Claims 7 4 Changing Default Behaviors 9 5 Configuration Options 11 6 API

More information

An Introduction to AJAX. By : I. Moamin Abughazaleh

An Introduction to AJAX. By : I. Moamin Abughazaleh An Introduction to AJAX By : I. Moamin Abughazaleh How HTTP works? Page 2 / 25 Classical HTTP Process Page 3 / 25 1. The visitor requests a page 2. The server send the entire HTML, CSS and Javascript code

More information

Introduction to Ajax. Sang Shin Java Technology Architect Sun Microsystems, Inc.

Introduction to Ajax. Sang Shin Java Technology Architect Sun Microsystems, Inc. Introduction to Ajax Sang Shin Java Technology Architect Sun Microsystems, Inc. sang.shin@sun.com www.javapassion.com Agenda 1.What is Rich User Experience? 2.Rich Internet Application (RIA) Technologies

More information

Copyright Descriptor Systems, Course materials may not be reproduced in whole or in part without prior written consent of Joel Barnum

Copyright Descriptor Systems, Course materials may not be reproduced in whole or in part without prior written consent of Joel Barnum Ajax The notion of asynchronous request processing using the XMLHttpRequest object has been around for several years, but the term "AJAX" was coined by Jesse James Garrett of Adaptive Path. You can read

More information

SETTING UP YOUR JAVA DEVELOPER ENVIRONMENT

SETTING UP YOUR JAVA DEVELOPER ENVIRONMENT SETTING UP YOUR JAVA DEVELOPER ENVIRONMENT Summary Configure your local dev environment for integrating with Salesforce using Java. This tipsheet describes how to set up your local environment so that

More information

SETTING UP YOUR JAVA DEVELOPER ENVIRONMENT

SETTING UP YOUR JAVA DEVELOPER ENVIRONMENT SETTING UP YOUR JAVA DEVELOPER ENVIRONMENT Summary Configure your local dev environment for integrating with Salesforce using Java. This tipsheet describes how to set up your local environment so that

More information

Using OAuth 2.0 to Access ionbiz APIs

Using OAuth 2.0 to Access ionbiz APIs Using OAuth 2.0 to Access ionbiz APIs ionbiz APIs use the OAuth 2.0 protocol for authentication and authorization. ionbiz supports common OAuth 2.0 scenarios such as those for web server, installed, and

More information

Amazon WorkDocs. Developer Guide

Amazon WorkDocs. Developer Guide Amazon WorkDocs Developer Guide Amazon WorkDocs: Developer Guide Copyright 2017 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used

More information

Aim behind client server architecture Characteristics of client and server Types of architectures

Aim behind client server architecture Characteristics of client and server Types of architectures QA Automation - API Automation - All in one course Course Summary: In detailed, easy, step by step, real time, practical and well organized Course Not required to have any prior programming knowledge,

More information

RESTful -Webservices

RESTful -Webservices International Journal of Scientific Research in Computer Science, Engineering and Information Technology RESTful -Webservices Lalit Kumar 1, Dr. R. Chinnaiyan 2 2018 IJSRCSEIT Volume 3 Issue 4 ISSN : 2456-3307

More information

Django REST Framework JSON API Documentation

Django REST Framework JSON API Documentation Django REST Framework JSON API Documentation Release 2.0.0-alpha.1 Jerel Unruh Jan 25, 2018 Contents 1 Getting Started 3 1.1 Requirements............................................... 4 1.2 Installation................................................

More information

Introduction to Cisco ECDS Software APIs

Introduction to Cisco ECDS Software APIs CHAPTER 1 This chapter contains the following sections: Overview of HTTPS APIs, page 1-1 Calling the HTTPS APIs, page 1-2 Sample Java Program, page 1-3 API Error Messages, page 1-5 API Tasks, page 1-7

More information

Networking & The Web. HCID 520 User Interface Software & Technology

Networking & The Web. HCID 520 User Interface Software & Technology Networking & The Web HCID 520 User Interface Software & Technology Uniform Resource Locator (URL) http://info.cern.ch:80/ 1991 HTTP v0.9 Uniform Resource Locator (URL) http://info.cern.ch:80/ Scheme/Protocol

More information

AJAX: Introduction CISC 282 November 27, 2018

AJAX: Introduction CISC 282 November 27, 2018 AJAX: Introduction CISC 282 November 27, 2018 Synchronous Communication User and server take turns waiting User requests pages while browsing Waits for server to respond Waits for the page to load in the

More information

! The final is at 10:30 am, Sat 6/4, in this room. ! Open book, open notes. ! No electronic devices. ! No food. ! Assignment 7 due 10pm tomorrow

! The final is at 10:30 am, Sat 6/4, in this room. ! Open book, open notes. ! No electronic devices. ! No food. ! Assignment 7 due 10pm tomorrow Announcements ECS 89 6/1! The final is at 10:30 am, Sat 6/4, in this room! Open book, open notes! No electronic devices! No food! Assignment 7 due 10pm tomorrow! No late Assignment 7 s! Fill out course

More information

Introduction to Cisco CDS Software APIs

Introduction to Cisco CDS Software APIs CHAPTER 1 Cisco Content Delivery System (CDS) software provides HyperText Transport Protocol Secure (HTTPS) application program interfaces (APIs) for monitoring and managing the acquisition and distribution

More information

Apache Wink User Guide

Apache Wink User Guide Apache Wink User Guide Software Version: 0.1 The Apache Wink User Guide document is a broad scope document that provides detailed information about the Apache Wink 0.1 design and implementation. Apache

More information

Web Programming Step by Step

Web Programming Step by Step Web Programming Step by Step Lecture 19 Ajax Reading: 10.1-10.2 Except where otherwise noted, the contents of this presentation are Copyright 2009 Marty Stepp and Jessica Miller. Synchronous web communication

More information

izzati Documentation Release Gustav Hansen

izzati Documentation Release Gustav Hansen izzati Documentation Release 1.0.0 Gustav Hansen Sep 03, 2017 Contents: 1 Why? 3 1.1 Features.................................................. 3 2 Quickstart - Backend 5 2.1 Installation................................................

More information

XMLHttpRequest. CS144: Web Applications

XMLHttpRequest. CS144: Web Applications XMLHttpRequest http://oak.cs.ucla.edu/cs144/examples/google-suggest.html Q: What is going on behind the scene? What events does it monitor? What does it do when

More information

JAX-RS and Jersey Paul Sandoz

JAX-RS and Jersey Paul Sandoz JAX-RS and Jersey Paul Sandoz JAX-RS co-spec lead and Jersey lead mailto:paul.sandoz@sun.com http://blogs.sun.com/sandoz https://twitter.com/paulsandoz/ 1 Overview Terminology Information & Status Integration

More information

Android tips. which simplify your life

Android tips. which simplify your life Android tips which simplify your life Android Studio beta gradle build system maven-based build dependencies build variants code completion, refactoring, templates graphical template editor Gradle apply

More information

5.1 Registration and Configuration

5.1 Registration and Configuration 5.1 Registration and Configuration Registration and Configuration Apache Wink provides several methods for registering resources and providers. This chapter describes registration methods and Wink configuration

More information

Web Application Security

Web Application Security Web Application Security Rajendra Kachhwaha rajendra1983@gmail.com September 23, 2015 Lecture 13: 1/ 18 Outline Introduction to AJAX: 1 What is AJAX 2 Why & When use AJAX 3 What is an AJAX Web Application

More information

Mobile Computing. Logic and data sharing. REST style for web services. Operation verbs. RESTful Services

Mobile Computing. Logic and data sharing. REST style for web services. Operation verbs. RESTful Services Logic and data sharing Mobile Computing Interface Logic Services Logic Data Sync, Caches, Queues Data Mobile Client Server RESTful Services RESTful Services 2 REST style for web services REST Representational

More information

COPYRIGHTED MATERIAL. AJAX Technologies. Google Suggest

COPYRIGHTED MATERIAL. AJAX Technologies. Google Suggest AJAX Technologies Traditional Web pages use server-side technologies and resources to operate and deliver their features and services to end users. These Web pages require end users to perform full-page

More information

Distributed Systems. 03r. Python Web Services Programming Tutorial. Paul Krzyzanowski TA: Long Zhao Rutgers University Fall 2017

Distributed Systems. 03r. Python Web Services Programming Tutorial. Paul Krzyzanowski TA: Long Zhao Rutgers University Fall 2017 Distributed Systems 03r. Python Web Services Programming Tutorial Paul Krzyzanowski TA: Long Zhao Rutgers University Fall 2017 1 From Web Browsing to Web Services Web browser: Dominant model for user interaction

More information

CS October 2017

CS October 2017 From Web Browsing to Web Services Web browser: Dominant model for user interaction on the Internet Distributed Systems 03r. Python Web Services Programming Tutorial Not good for programmatic access to

More information

Introduction to Cisco CDS Software APIs

Introduction to Cisco CDS Software APIs CHAPTER 1 Cisco Content Delivery System (CDS) software provides HyperText Transport Protocol Secure (HTTPS) application program interfaces (APIs) for monitoring and managing the acquisition and distribution

More information

ExtraHop Rest API Guide

ExtraHop Rest API Guide ExtraHop Rest API Guide Version 5.0 Introduction to ExtraHop REST API The ExtraHop REST application programming interface (API) enables you to automate administration and configuration tasks on your ExtraHop

More information

ANDROID BASED WS SECURITY AND MVC BASED UI REPRESENTATION OF DATA

ANDROID BASED WS SECURITY AND MVC BASED UI REPRESENTATION OF DATA ANDROID BASED WS SECURITY AND MVC BASED UI REPRESENTATION OF DATA Jitendra Ingale, Parikshit mahalle SKNCOE pune,maharashtra,india Email: jits.ingale@gmail.com ABSTRACT: Google s Android is open source;

More information

Networking & The Web. HCID 520 User Interface Software & Technology

Networking & The Web. HCID 520 User Interface Software & Technology Networking & The HCID 520 User Interface Software & Technology Uniform Resource Locator (URL) http://info.cern.ch:80/ 1991 HTTP v0.9 Uniform Resource Locator (URL) http://info.cern.ch:80/ Scheme/Protocol

More information

HOW TO MAKE A FULL FLEDGED REST API. with DJANGO OAUTH TOOLKIT

HOW TO MAKE A FULL FLEDGED REST API. with DJANGO OAUTH TOOLKIT HOW TO MAKE A FULL FLEDGED REST API with DJANGO OAUTH TOOLKIT FEDERICO FRENGUELLI @synasius http://evonove.it GOALS OAuth2 protected REST API with Django WHY? INTRODUCING the marvelous TIMETRACKER ONCE

More information

WWW. HTTP, Ajax, APIs, REST

WWW. HTTP, Ajax, APIs, REST WWW HTTP, Ajax, APIs, REST HTTP Hypertext Transfer Protocol Request Web Client HTTP Server WSGI Response Connectionless Media Independent Stateless Python Web Application WSGI : Web Server Gateway Interface

More information

SAS Event Stream Processing 4.2: Security

SAS Event Stream Processing 4.2: Security SAS Event Stream Processing 4.2: Security Encryption on Sockets Overview to Enabling Encryption You can enable encryption on TCP/IP connections within an event stream processing engine. Specifically, you

More information

Asynchronous JavaScript + XML (Ajax)

Asynchronous JavaScript + XML (Ajax) Asynchronous JavaScript + XML (Ajax) CSE 190 M (Web Programming), Spring 2008 University of Washington References: w3schools, Wikipedia Except where otherwise noted, the contents of this presentation are

More information

Apache Wink Developer Guide. Draft Version. (This document is still under construction)

Apache Wink Developer Guide. Draft Version. (This document is still under construction) Apache Wink Developer Guide Software Version: 1.0 Draft Version (This document is still under construction) Document Release Date: [August 2009] Software Release Date: [August 2009] Apache Wink Developer

More information

Cloud Trace Service. API Reference. Issue 01 Date

Cloud Trace Service. API Reference. Issue 01 Date Issue 01 Date 2016-12-30 Contents Contents 1 API Calling... 1 1.1 Service Usage... 1 1.2 Making a Request... 1 1.3 Request Authentication Methods...2 1.4 Token Authentication...2 1.5 AK/SK Authentication...

More information

Escher Documentation. Release Emarsys

Escher Documentation. Release Emarsys Escher Documentation Release 0.4.0 Emarsys Sep 27, 2017 Contents 1 Announcement 3 2 Contents 5 2.1 Specification............................................... 5 2.2 Configuring Escher............................................

More information

Packaging Data for the Web

Packaging Data for the Web Packaging Data for the Web EN 605.481 Principles of Enterprise Web Development Overview Both XML and JSON can be used to pass data between remote applications, clients and servers, etc. XML Usually heavier

More information

Restful Application Development

Restful Application Development Restful Application Development Instructor Welcome Currently a consultant in my own business and splitting my time between training and consulting. Rob Gance Assist clients to incorporate Web 2.0 technologies

More information

FIRE (3473) Dallas Los Angeles Sydney New York London

FIRE (3473) Dallas Los Angeles Sydney New York London Traditional project life cycles lasting 12+ months are increasingly putting organizations at a disadvantage to more nimble startups that can innovate and change direction at a faster pace. New Agile development

More information

Node.js. Node.js Overview. CS144: Web Applications

Node.js. Node.js Overview. CS144: Web Applications Node.js Node.js Overview JavaScript runtime environment based on Chrome V8 JavaScript engine Allows JavaScript to run on any computer JavaScript everywhere! On browsers and servers! Intended to run directly

More information

IN Development in Platform Ecosystems Lecture 3: json, ajax, APIs

IN Development in Platform Ecosystems Lecture 3: json, ajax, APIs IN5320 - Development in Platform Ecosystems Lecture 3: json, ajax, APIs 3rd of September 2018 Department of Informatics, University of Oslo Magnus Li - magl@ifi.uio.no 1 Today s lecture 1. Objects and

More information

django-oauth2-provider Documentation

django-oauth2-provider Documentation django-oauth2-provider Documentation Release 0.2.7-dev Alen Mujezinovic Aug 16, 2017 Contents 1 Getting started 3 1.1 Getting started.............................................. 3 2 API 5 2.1 provider.................................................

More information

Using SailFin and Eclipse to build SIP-based and RESTful applications

Using SailFin and Eclipse to build SIP-based and RESTful applications Using SailFin and Eclipse to build SIP-based and RESTful applications Presented by: Fatna Belqasmi, PhD, Researcher associate at Concordia University Agenda Download and installation Configuration Create

More information

Introduc)on to JAX- RS 3/14/12

Introduc)on to JAX- RS 3/14/12 JAX-RS: The Java API for RESTful Web Services Asst. Prof. Dr. Kanda Runapongsa Saikaew (krunapon@kku.ac.th) Mr.Pongsakorn Poosankam (pongsakorn@gmail.com) 1 q Goals of JAX-RS q Creating resources q HTTP

More information

HP ArcSight ESM: Service Layer

HP ArcSight ESM: Service Layer HP ArcSight ESM: Service Layer Software Version: 1.0 Developer's Guide February 16, 2016 Legal Notices Warranty The only warranties for HP products and services are set forth in the express warranty statements

More information

django-dajaxice Documentation

django-dajaxice Documentation django-dajaxice Documentation Release 0.7 Jorge Bastida Nov 17, 2017 Contents 1 Documentation 3 1.1 Installation................................................ 3 1.2 Quickstart................................................

More information

May 13, 2015 [MSDP SERVICES INTEGRATION DOCUMENT VER 1.4] Page 1 of 23

May 13, 2015 [MSDP SERVICES INTEGRATION DOCUMENT VER 1.4] Page 1 of 23 Page 1 of 23 Table of Contents 1. Push SMS Integration... 3 1.1 Overview... 3 1.2 Terms and Definitions... 3 1.3 Using the HTTP URL for sending messages... 3 1.4 PUSH Account Creation... 3 1.5 PUSH Parameter

More information

Elevate Web Builder Modules Manual

Elevate Web Builder Modules Manual Table of Contents Elevate Web Builder Modules Manual Table Of Contents Chapter 1 - Getting Started 1 1.1 Creating a Module 1 1.2 Handling Requests 3 1.3 Custom DataSet Modules 8 Chapter 2 - Component Reference

More information

Java SE7 Fundamentals

Java SE7 Fundamentals Java SE7 Fundamentals Introducing the Java Technology Relating Java with other languages Showing how to download, install, and configure the Java environment on a Windows system. Describing the various

More information

JSR 311: JAX-RS: The Java API for RESTful Web Services

JSR 311: JAX-RS: The Java API for RESTful Web Services JSR 311: JAX-RS: The Java API for RESTful Web Services Marc Hadley, Paul Sandoz, Roderico Cruz Sun Microsystems, Inc. http://jsr311.dev.java.net/ TS-6411 2007 JavaOne SM Conference Session TS-6411 Agenda

More information

Specification on tables display(ergonomics) in PhpPgAdmin 4.2.3

Specification on tables display(ergonomics) in PhpPgAdmin 4.2.3 Specification on tables display(ergonomics) in PhpPgAdmin 4.2.3 Author: Didier SERVOZ Compagny: BULL SA France Manager: Thierry MISSILLY Date:21/06/10 Table of contents Table of contents...2 1 Background...3

More information

Portlets and Ajax: Building More Dynamic Web Apps

Portlets and Ajax: Building More Dynamic Web Apps Portlets and Ajax: Building More Dynamic Web Apps Subbu Allamaraju Senior Staff Engineer BEA Systems, Inc. TS-4003 2007 JavaOne SM Conference Session TS-4003 Goals Goals of the of Session the Session Learn

More information

,pm-diffs.patch -408, ,13

,pm-diffs.patch -408, ,13 ,pm-diffs.patch diff -r 763e4be166aa edu.harvard.i2b2.pm/src/edu/harvard/i2b2/pm/delegate/serviceshandler.java --- a/edu.harvard.i2b2.pm/src/edu/harvard/i2b2/pm/delegate/serviceshandler.java Wed Aug 11

More information

Intro to Android Development 3. Accessibility Capstone Dec 10, 2010

Intro to Android Development 3. Accessibility Capstone Dec 10, 2010 Intro to Android Development 3 Accessibility Capstone Dec 10, 2010 Using Web Services HTTP Request HTTP Response Using Web Services HTTP Request HTTP Response webserver some program Why use a web service?

More information

COT 3530: Data Structures. Giri Narasimhan. ECS 389; Phone: x3748

COT 3530: Data Structures. Giri Narasimhan. ECS 389; Phone: x3748 COT 3530: Data Structures Giri Narasimhan ECS 389; Phone: x3748 giri@cs.fiu.edu www.cs.fiu.edu/~giri/teach/3530spring04.html Evaluation Midterm & Final Exams Programming Assignments Class Participation

More information

Creating a REST API which exposes an existing SOAP Service with IBM API Management

Creating a REST API which exposes an existing SOAP Service with IBM API Management Creating a REST API which exposes an existing SOAP Service with IBM API Management 4.0.0.0 2015 Copyright IBM Corporation Page 1 of 33 TABLE OF CONTENTS OBJECTIVE...3 PREREQUISITES...3 CASE STUDY...4 USER

More information

Type: Web Service API Doc. Name.: XTEST Review: Date: 19 giugno, 2015

Type: Web Service API Doc. Name.: XTEST Review: Date: 19 giugno, 2015 Type: Web Service API Doc. Name.: XTEST Review: 4.9.1 Date: 19 giugno, 2015 All information, data, ideas, layouts, drawings, schemes and all their combinations thereof are proprietary information of THRON

More information

CSC309: Introduction to Web Programming. Lecture 11

CSC309: Introduction to Web Programming. Lecture 11 CSC309: Introduction to Web Programming Lecture 11 Wael Aboulsaadat Servlets+JSP Model 2 Architecture 2 Servlets+JSP Model 2 Architecture = MVC Design Pattern 3 Servlets+JSP Model 2 Architecture Controller

More information

So, if you receive data from a server, in JSON format, you can use it like any other JavaScript object.

So, if you receive data from a server, in JSON format, you can use it like any other JavaScript object. What is JSON? JSON stands for JavaScript Object Notation JSON is a lightweight data-interchange format JSON is "self-describing" and easy to understand JSON is language independent * JSON uses JavaScript

More information

Session 18. jquery - Ajax. Reference. Tutorials. jquery Methods. Session 18 jquery and Ajax 10/31/ Robert Kelly,

Session 18. jquery - Ajax. Reference. Tutorials. jquery Methods. Session 18 jquery and Ajax 10/31/ Robert Kelly, Session 18 jquery - Ajax 1 Tutorials Reference http://learn.jquery.com/ajax/ http://www.w3schools.com/jquery/jquery_ajax_intro.asp jquery Methods http://www.w3schools.com/jquery/jquery_ref_ajax.asp 2 10/31/2018

More information

Requirement Document v1.1 WELCOME TO CANLOG.IN. API Help Document. Version SMS Integration Document

Requirement Document v1.1 WELCOME TO CANLOG.IN. API Help Document. Version SMS Integration Document WELCOME TO CANLOG.IN API Help Document Version 1.1 http://www.canlog.in SMS Integration Document Integration 1. Purpose SMS integration with Canlog enables you to notify your customers and agents via Text

More information

Backend. (Very) Simple server examples

Backend. (Very) Simple server examples Backend (Very) Simple server examples Web server example Browser HTML form HTTP/GET Webserver / Servlet JDBC DB Student example sqlite>.schema CREATE TABLE students(id integer primary key asc,name varchar(30));

More information

Contents. Demos folder: Demos\14-Ajax. 1. Overview of Ajax. 2. Using Ajax directly. 3. jquery and Ajax. 4. Consuming RESTful services

Contents. Demos folder: Demos\14-Ajax. 1. Overview of Ajax. 2. Using Ajax directly. 3. jquery and Ajax. 4. Consuming RESTful services Ajax Contents 1. Overview of Ajax 2. Using Ajax directly 3. jquery and Ajax 4. Consuming RESTful services Demos folder: Demos\14-Ajax 2 1. Overview of Ajax What is Ajax? Traditional Web applications Ajax

More information

Black Box DCX3000 / DCX1000 Using the API

Black Box DCX3000 / DCX1000 Using the API Black Box DCX3000 / DCX1000 Using the API updated 2/22/2017 This document will give you a brief overview of how to access the DCX3000 / DCX1000 API and how you can interact with it using an online tool.

More information

Lesson 12: JavaScript and AJAX

Lesson 12: JavaScript and AJAX Lesson 12: JavaScript and AJAX Objectives Define fundamental AJAX elements and procedures Diagram common interactions among JavaScript, XML and XHTML Identify key XML structures and restrictions in relation

More information