You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,8 @@ Open URL http://localhost/test.pas from Internet browser, you should see text `H
73
73
74
74
If `test.pas` is downloaded then you do not register mod_pascal with Apache correctly.
75
75
76
+
When not set, `Content-Type` response header is assumed `text/html`.
77
+
76
78
To return response with header, add header line separated by newline
77
79
78
80
```
@@ -82,6 +84,15 @@ begin
82
84
writeln('<h1>Hello from Pascal</h1>');
83
85
end.
84
86
```
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
+
```
85
96
86
97
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
0 commit comments