background preloader

Learn REST: A Tutorial

Learn REST: A Tutorial
Related:  API JSON

SEO for Image-based Websites As an amateur artist myself, and having built several websites for professional visual artists over the years, it has become apparent to me that special consideration is required when building a site focused around imagery. Although Google is getting better at recognising images and interpreting their contents, you still can’t really get accurate search results based on an image itself. So how is it possible to optimise an image-based site? Here’s what Google’s Matt Cutts has to say on the subject. So the key to getting your image-based site noticed by the search engines is to optimise the text around your images. This includes image captions, page titles, ‘alt’ properties, and paragraph text around the image. Consider writing about the origins of the image, or where the idea came from. The power of blogging Another thing I would recommend for any visual artist is to have a blog on your site. Socialise Join art communities Keep it coming

JSend What? - Put simply, JSend is a specification that lays down some rules for how JSON responses from web servers should be formatted. JSend focuses on application-level (as opposed to protocol- or transport-level) messaging which makes it ideal for use in REST-style applications and APIs. Why? - There are lots of web services out there providing JSON data, and each has its own way of formatting responses. So how's it work? A basic JSend-compliant response is as simple as this: When setting up a JSON API, you'll have all kinds of different types of calls and responses. Example response types ¶ Success: When an API call is successful, the JSend object is used as a simple envelope for the results, using the data key, as in the following: GET /posts.json: GET /posts/2.json: DELETE /posts/2.json: Required keys: status: Should always be set to "success". data: Acts as the wrapper for any data returned by the API call. POST /posts.json (with data body: "Trying to creating a blog post"): Optional keys:

Best Practices for Designing a Pragmatic RESTful API | Vinay Sahni Your data model has started to stabilize and you're in a position to create a public API for your web app. You realize it's hard to make significant changes to your API once it's released and want to get as much right as possible up front. Now, the internet has no shortage on opinions on API design. But, since there's no one widely adopted standard that works in all cases, you're left with a bunch of choices: What formats should you accept? How should you authenticate? In designing an API for Enchant (a Zendesk Alternative), I've tried to come up with pragmatic answers to these questions. ... or just skip to the bottom and signup for updates Latest from the Enchant blog How to make your app lovable A decent app helps you get the job done. ... and those apps, the ones that make things feel effortless, are the ones we love the most. But what makes an app feel effortless? Key requirements for the API Use RESTful URLs and actions But what can I make a resource? SSL everywhere - all the time

JWT: JSON Web Tokens in AngularJS and Laravel With the rising popularity of single page applications, mobile applications, and RESTful API services, the way web developers write back-end code has changed significantly. With technologies like AngularJS and BackboneJS, we are no longer spending much time building markup, instead we are building APIs that our front-end applications consume. Our back-end is more about business logic and data, while presentation logic is moved exclusively to the front-end or mobile applications. These changes have led to new ways of implementing authentication in modern applications. Authentication is one of the most important parts of any web application. What is a JSON Web Token? A JSON Web Token, or JWT, is used to send information that can be verified and trusted by means of a digital signature. Because of it’s compact structure, JWT is usually used in HTTP Authorization headers or URL query parameters. Structure of a JSON Web Token JSON Web Token example: Example Header Payload (Claims) Registered Claims

REST API Tutorial Designing a Website’s Introductory Text: Tips and Examples Many websites choose to display a short explanatory text in a prominent position of their web page layouts to inform visitors what the purpose of the site is. This introductory text, when crafted well, can help users quickly decide whether they’re in the right place or not. A website has mere seconds to let visitors know that they’ve found what they’re looking for, and your site introduction is your brief elevator pitch towards that. We’ll explore the use of website introductory text in various types of websites to gain a better understanding of trends and techniques for effectively designing them. At the end of this article, there’s also a showcase of some excellent web designs that have great website introductory text for our further exploration of the topic. Design Goals There needs to be a purpose for every component of a website. In this way, a thoughtful approach to the design and the copy of your website introductory text is important. The goals of your site introduction are: Be Direct

Console API - FirebugWiki From FirebugWiki Firebug adds a global JavaScript variable named "console" to all web pages loaded in Firefox. This object contains many methods that allow you to write to the Firebug console to expose information that is flowing through your scripts. [edit] Commands [edit] console.log(object[, object, ...]) Writes a message to the console. [edit] console.debug(object[, object, ...]) Writes a message to the console, including a hyperlink to the line where it was called. [edit][, object, ...]) Writes a message to the console with the visual "info" icon and color coding and a hyperlink to the line where it was called. [edit] console.warn(object[, object, ...]) Writes a message to the console with the visual "warning" icon and color coding and a hyperlink to the line where it was called. [edit] console.error(object[, object, ...]) Writes a message to the console with the visual "error" icon and color coding and a hyperlink to the line where it was called. [edit] console.clear()

Cookies vs Tokens. Getting auth right with Angular.JS Introduction There are basically two different ways of implementing server side authentication for apps with a frontend and an API: The most adopted one, is Cookie-Based Authentication (you can find an example here) that uses server side cookies to authenticate the user on every request.A newer approach, Token-Based Authentication, relies on a signed token that is sent to the server on each request. Token based vs. Cookie based The following diagram explains how both of these methods work. What are the benefits of using a token-based approach? Cross-domain / CORS: cookies + CORS don't play well across different domains. What's JSON Web Token? Asuming you have a node.js app, below you can find the components of this architecture. Server Side Let's start by installing express-jwt and jsonwebtoken: $ npm install express-jwt jsonwebtoken Configure the express middleware to protect every call to /api. The angular app will perform a POST through AJAX with the user's credentials: Angular Side What's next?

RESTful Web services: The basics The basics REST defines a set of architectural principles by which you can design Web services that focus on a system's resources, including how resource states are addressed and transferred over HTTP by a wide range of clients written in different languages. If measured by the number of Web services that use it, REST has emerged in the last few years alone as a predominant Web service design model. REST didn't attract this much attention when it was first introduced in 2000 by Roy Fielding at the University of California, Irvine, in his academic dissertation, "Architectural Styles and the Design of Network-based Software Architectures," which analyzes a set of software architecture principles that use the Web as a platform for distributed computing (see Resources for a link to this dissertation). This article suggests that in its purest form today, when it's attracting this much attention, a concrete implementation of a REST Web service follows four basic design principles: Back to top

MySQL for Absolute Beginners Tutorial by Matt Doyle | Level: Beginner | Published on 25 August 2011 Categories: Never used MySQL before? A database is an essential part of most websites and blogs, but setting up and using a database can be a daunting task for the beginner web developer. In this tutorial you'll learn — in simple terms — how to install, set up, and use a MySQL database on your computer. You'll explore the following areas in this tutorial: The concept of a database, and why databases are useful The advantages of using MySQL to manage your databases How to install MySQL on your computer Using the MySQL Monitor program to send commands to your MySQL server How to create a database and table SQL (Structured Query Language), and what it's used for Adding records to a table, and retrieving records from a table Ready to start exploring MySQL? What is a database? database is a structured collection of data. The software that manages databases is known as a database management system , or . Why use a database? . table

js - jQuery plugin for HTML5+JSON interactive tables and more Demo Processing... To get started, simply install jquery.dynatable.js (along with jQuery), and add the following in the document.ready or after the table: $('#my-table').dynatable(); How it works Dynatable does three things: Read / Normalize The HTML table is scanned and normalized into an array of JSON objects (or collection) where each JSON object (or record) corresponds to a row in the table. This 3-step approach has several advantages: Efficient reading/operating/writing Since the logic and operations occur on the JSON collection, the DOM operations (reading and writing/drawing) are grouped together, making interactions quick and efficient. Normalization The first module normalizes an HTML table into a JSON collection. The following table: Results in this JSON collection: Converting attribute names By default, dynatable converts headings to JSON attribute names using: We could also define our own column-name transformation function. Click the button to the right. Run Code So this: Existing JSON

HTTP Basic Auth | Flask (A Python Microframework) By Armin Ronacher filed in Authentication For very simple applications HTTP Basic Auth is probably good enough. Flask makes this very easy. To use this decorator, just wrap a view function: @app.route('/secret-page')@requires_authdef secret_page(): return render_template('secret_page.html') If you are using basic auth with mod_wsgi you will have to enable auth forwarding, otherwise apache consumes the required headers and does not send it to your application: WSGIPassAuthorization. This snippet by Armin Ronacher can be used freely for anything you like.

Representational state transfer Representational State Transfer (REST) is a software architecture style consisting of guidelines and best practices for creating scalable web services.[1][2] REST is a coordinated set of constraints applied to the design of components in a distributed hypermedia system that can lead to a more performant and maintainable architecture.[3] REST has gained widespread acceptance across the Web[citation needed] as a simpler alternative to SOAP and WSDL-based Web services. RESTful systems typically, but not always, communicate over the Hypertext Transfer Protocol with the same HTTP verbs (GET, POST, PUT, DELETE, etc.) used by web browsers to retrieve web pages and send data to remote servers.[3] The REST architectural style was developed by W3C Technical Architecture Group (TAG) in parallel with HTTP 1.1, based on the existing design of HTTP 1.0.[4] The World Wide Web represents the largest implementation of a system conforming to the REST architectural style. Architectural properties[edit]

Related:  WeiterbildungTecnología