Skip to content

Commit c5f41a5

Browse files
authored
Update index.md
1 parent 1ad89f6 commit c5f41a5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ Open URL http://localhost/test.pas from Internet browser, you should see text `H
7373

7474
If `test.pas` is downloaded then you do not register mod_pascal with Apache correctly.
7575

76+
When not set, `Content-Type` response header is assumed `text/html`.
77+
7678
To return response with header, add header line separated by newline
7779

7880
```
@@ -82,6 +84,15 @@ begin
8284
writeln('<h1>Hello from Pascal</h1>');
8385
end.
8486
```
87+
or as JSON
88+
89+
```
90+
begin
91+
writeln('Content-Type : application/json');
92+
writeln();
93+
writeln('{"message":"Hello from Pascal"}');
94+
end.
95+
```
8596

8697
Please note that because blank newline is used to mark end of header parts of response, for safety, always add them even if you do not want to set response header. For example
8798

0 commit comments

Comments
 (0)