Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/language-basics/enums.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ or float

```typespec
enum Hour {
Zero = 0,
Quarter = 0.25,
Half = 0.5,
ThreeQuarter = 0.75,
Zero: 0,
Quarter: 0.25,
Half: 0.5,
ThreeQuarter: 0.75,
}
```

Expand Down
13 changes: 4 additions & 9 deletions docs/standard-library/http/content-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,15 @@

## Default behavior

Depending on the body of the operation http library will assume different content types:

- `bytes`: `application/octet-stream`
- `string`: `text/plain`
- otherwise `application/json`
Content type is assumed to be `application/json` by default regardless of the type of the request or response body.

**Examples:**

```typespec
op download(): bytes; // response content type is application/octet-stream
op upload(@body file: bytes): void; // request content type is application/octet-stream
op getContent(): string; // response content type is text/plain
op download(): bytes; // Returns a json string with the bytes serialized as a base64.
op getContent(): string; // Returns a json string
op getPet(): {
// response content type is application/json
// Json object with a name property.
name: string;
};
```
Expand Down