Creating an API for mobile applications – Authentication and Authorization

Overview I’m looking to create a (REST) API for my application. The initial/primary purpose will be for consumption by mobile apps (iPhone, Android, Symbian, etc). I’ve been looking into different mechanisms for authentication and authorization for web-based APIs (by studying other implementations). I’ve got my head wrapped around most of the fundamental concepts but am … Read more

URL matrix parameters vs. query parameters

I’m wondering whether to use matrix or query parameters in my URLs. I found an older discussion to that topic not satisfying. Examples URL with query params: http://some.where/thing?paramA=1&paramB=6542 URL with matrix params: http://some.where/thing;paramA=1;paramB=6542 At first sight matrix params seem to have only advantages: more readable no encoding and decoding of “&” in XML documents is … Read more

Which HTTP status code means “Not Ready Yet, Try Again Later”? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago. This post was edited and submitted for review 6 days ago and failed to reopen the post: Original close … Read more

Spring Boot REST service exception handling

I am trying to set up a large-scale REST services server. We’re using Spring Boot 1.2.1 Spring 4.1.5, and Java 8. Our controllers are implementing @RestController and the standard @RequestMapping annotations. My problem is that Spring Boot sets up a default redirect for controller exceptions to /error. From the docs: Spring Boot provides an /error … Read more

Django REST Framework: adding additional field to ModelSerializer

I want to serialize a model, but want to include an additional field that requires doing some database lookups on the model instance to be serialized: class FooSerializer(serializers.ModelSerializer): my_field = … # result of some database queries on the input Foo object class Meta: model = Foo fields = (‘id’, ‘name’, ‘myfield’) What is the … Read more

ReferenceError: describe is not defined NodeJs

I am trying to define some endpoints and do a test using nodejs. In server.js I have: var express = require(‘express’); var func1 = require(‘./func1.js’); var port = 8080; var server = express(); server.configure(function(){ server.use(express.bodyParser()); }); server.post(‘/testend/’, func1.testend); and in func1.js: var testend = function(req, res) { serialPort.write(“1”, function(err, results) { serialPort.write(“2” + “\n”, function(err, … Read more