Skip to content

Commit 6a20cb0

Browse files
committed
Merge remote-tracking branch 'origin/main' into main
2 parents a9fff7a + aeabf9f commit 6a20cb0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -996,10 +996,18 @@ builder.Services.AddRazorPages();
996996
builder.Services.AddControllers(options =>
997997
{
998998
options.InputFormatters.Insert(0, new MemoryPackInputFormatter());
999-
options.OutputFormatters.Insert(0, new MemoryPackOutputFormatter());
999+
// If checkContentType: true then can output multiple format(JSON/MemoryPack, etc...). default is false.
1000+
options.OutputFormatters.Insert(0, new MemoryPackOutputFormatter(checkContentType: false));
10001001
});
10011002
```
10021003

1004+
If you call from HttpClient, you can set `application/x-memorypack` to content-header.
1005+
1006+
```csharp
1007+
var content = new ByteArrayContent(bin)
1008+
content.Headers.ContentType = new MediaTypeHeaderValue("application/x-memorypack");
1009+
```
1010+
10031011
### TypeScript Type Mapping
10041012

10051013
There are a few restrictions on the types that can be generated. Among the primitives, `char` and `decimal` are not supported. Also, OpenGenerics type cannot be used.

0 commit comments

Comments
 (0)