Skip to content

Commit

Permalink
Add information about the conversion for non-json types
Browse files Browse the repository at this point in the history
  • Loading branch information
TharmiganK committed Sep 5, 2024
1 parent 0cb5cf9 commit 0c9bbbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ballerina/http_request.bal
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,8 @@ public class Request {

# Sets the request payload. This method overrides any existing content-type by passing the content-type
# as an optional parameter. If the content type parameter is not provided then the default value derived
# from the payload will be used as content-type only when there are no existing content-type header.
# from the payload will be used as content-type only when there are no existing content-type header. If
# the payload is non-json typed value then the value is converted to json using the `toJson` method.
#
# + payload - Payload can be of type `anydata`, `stream<byte[], io:Error?>`
# or `Entity[]` (i.e., a set of body parts).
Expand Down
3 changes: 2 additions & 1 deletion ballerina/http_response.bal
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,8 @@ public class Response {

# Sets the response payload. This method overrides any existing content-type by passing the content-type
# as an optional parameter. If the content type parameter is not provided then the default value derived
# from the payload will be used as content-type only when there are no existing content-type header.
# from the payload will be used as content-type only when there are no existing content-type header. If
# the payload is non-json typed value then the value is converted to json using the `toJson` method.
#
# + payload - Payload can be of type `anydata`, `stream<byte[], io:Error?>`, stream<SseEvent, error?>,
# or `Entity[]` (i.e., a set of body parts).
Expand Down

0 comments on commit 0c9bbbe

Please sign in to comment.