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
@@ -264,8 +264,8 @@ Start Apache httpd web server using
264
264
/usr/sbin/apache2 -X -d ./cgi/apache2
265
265
```
266
266
267
-
To test the [CGI script](http://localhost:8080/cgi-bin/newtonraphson) we can not use the web browser, but need to use http client like [curl](https://curl.haxx.se/).
268
-
A web browser uses the [GET http request method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET) and `text/html` as content type, but the CGI script requires a [POST http request method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) and JSON string as request body.
267
+
To test the [CGI script](http://localhost:8080/cgi-bin/newtonraphson) we can not use a web browser, but need to use http client like [curl](https://curl.haxx.se/).
268
+
Because, a web browser uses the [GET http request method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET) and `text/html` as content type, but the CGI script requires a [POST http request method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) and JSON string as request body.
269
269
The curl command with a POST request can be run in another shell with
270
270
271
271
```shell
@@ -283,9 +283,9 @@ Should return the following JSON document as a response
283
283
}
284
284
```
285
285
286
-
Instead of curl we could use any http client in any language to consume the web service.
286
+
Instead of curl, we could use any http client in any language to consume the web service.
287
287
288
-
The problem with CGI scripts is when the program does some initialization, you have to wait for it each visit. It is
288
+
The problem with CGI scripts is when the program does some initialization, you have to wait for it on each visit. It is
289
289
better to do the initialization once when the web service is starting up.
290
290
291
291
## Python web service
@@ -294,7 +294,7 @@ better to do the initialization once when the web service is starting up.
294
294
295
295
| Pros | Cons |
296
296
| --- | --- |
297
-
|:heart: Python is great glue language |:no_entry: Pure Python is slower than C++ |
297
+
|:heart: Python is a very popular language and has a large ecosystem|:no_entry: Pure Python is slower than C++ |
298
298
|:heart: Web service discoverable and documented with OpenAPI specification |:no_entry: Exception thrown from C++ has number instead of message |
299
299
300
300
Writing a web service in C++ can be done, but other languages like Python are better equipped. Python has a big
0 commit comments