alternative cotnent-type

@alpmestan @christian-marie I would think something like this, but I am also not an expert here, sadly. Who was the original author?
This commit is contained in:
bwo 2015-07-07 21:25:32 -07:00
parent 9c50804c6f
commit 7c98f57f6c

View file

@ -37,6 +37,7 @@ generateJS req = "\n" <>
<> " $.ajax(\n"
<> " { url: " <> url <> "\n"
<> " , success: onSuccess\n"
<> contentType
<> dataBody
<> reqheaders
<> " , error: onError\n"
@ -68,6 +69,11 @@ generateJS req = "\n" <>
then "\n , data: JSON.stringify(body)\n"
else ""
contentType =
if req ^. reqBody
then "\n , contentType: 'application/json'\n"
else ""
reqheaders =
if null hs
then ""