# New Enhancements to Codename One's REST API

DevFeed: [New Enhancements to Codename One's REST API](<https://devfeed.tech/articles/new-rest-calls-19409.md>)

Original publisher: [Read original article](<https://www.codenameone.com/blog/new-rest-calls/>)

Author: Shai Almog

Published: 2018-02-07T00:00:00Z

Content type: tutorial

Language: en

Sources: [CodeName One](<https://devfeed.tech/sources/codename-one.md>)

Topics: [REST API](<https://devfeed.tech/topics/rest-api.md>), [Development](<https://devfeed.tech/topics/development.md>), [HTTP](<https://devfeed.tech/topics/http.md>), [JSON](<https://devfeed.tech/topics/json.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [development](<https://devfeed.tech/tags/development.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [http](<https://devfeed.tech/tags/http.md>), [json](<https://devfeed.tech/tags/json.md>), [rest](<https://devfeed.tech/tags/rest.md>)

## AI overview

This tutorial describes enhancements to Codename One's REST API, including explicit content-type handling, a JSON-content shorthand, and simpler asynchronous callbacks with optional error handling.

## Source excerpt

I really like the newer Rest API's Chen added a while back. They are ultimately far more convenient than the ConnectionRequest API's for most day to day development. In fact I used them almost exclusively in the Uber clone app. As a result of that I added a few useful enhancements and capabilities. If you are not familiar with the API it works roughly like this: Map<String, Object> jsonData = Rest. get(myUrl). acceptJson(). getAsJsonMap(); This will request using an HTTP GET method from the url. It will set the accepts header to JSON and parse the response.