# Request Body, Dialog & Border Layout

DevFeed: [Request Body, Dialog & Border Layout](<https://devfeed.tech/articles/request-body-dialog-border-layout-19493.md>)

Original publisher: [Read original article](<https://www.codenameone.com/blog/request-body-dialog-border-layout/>)

Author: Shai Almog

Published: 2016-11-30T00:00:00Z

Content type: release

Language: en

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

Topics: [API](<https://devfeed.tech/topics/api.md>), [JSON](<https://devfeed.tech/topics/json.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [code](<https://devfeed.tech/tags/code.md>), [json](<https://devfeed.tech/tags/json.md>)

## AI overview

The article describes API improvements for submitting request bodies, including a simpler way to send JSON without subclassing. It also introduces dialog constructors that accept layout managers and BorderLayout conveniences, including enclose methods and more flexible constraint handling.

## Source excerpt

Subclassing isn't bad but it becomes tedious especially if it's just there to implement something trivial. One of the pain points we had with the ConnectionRequest API's is the submission body wasn't as convenient as it should be. E.g. if my web service accepts JSON in the post argument I have to write something like this: ConnectionRequest r = new ConnectionRequest(myURL, true) { protected void buildRequestBody(OutputStream os) throws IOException { os.write(myJSON.getBytes("UTF-8")); } }; This works great but does it really require subclassing?