Skip to content

Commit bbe18de

Browse files
author
SGrondin
committed
Improved OCaml
1 parent f561925 commit bbe18de

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/targets/ocaml/cohttp.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = function (options) {
1010
var code = [];
1111

1212
code.push('open Cohttp_lwt_unix');
13+
code.push('open Cohttp');
1314
code.push('open Lwt');
1415
code.push('');
1516

@@ -45,7 +46,7 @@ module.exports = function (options) {
4546

4647
if (bodyPresent) {
4748
// Just text
48-
code.push(util.format('let body = %s in', JSON.stringify(this.source.postData.text)));
49+
code.push(util.format('let body = Cohttp_lwt_unix.of_string %s in', JSON.stringify(this.source.postData.text)));
4950
} else if (this.source.postData && !this.source.postData.text && this.source.postData.params && this.source.postData.params.length) {
5051
// Post params
5152
bodyPresent = true;
@@ -54,7 +55,7 @@ module.exports = function (options) {
5455
return param.name + '=' + param.value;
5556
}).join('&');
5657

57-
code.push(util.format('let body = "%s" in', body));
58+
code.push(util.format('let body = Cohttp_lwt_unix.of_string "%s" in', body));
5859
}
5960

6061
// Do the request

0 commit comments

Comments
 (0)