As Aaron said, you can take 'backandService.ts' file from /app/service folder in my repository at
https://github.com/backand/ionic2-crud-example
Here you have direct link to file.
If you are using Typescript, you will be able to load it with this snippet:
import {BackandService} from '../../services/backandService'
Inject BackandService in you constructor:
constructor(public backandService:BackandService) {
}
And do login like this:
this.backandService.getAuthTokenSimple(this.username, this.password);
And then post data with this code:
this.backandService.postItem(this.name)