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:
parent
9c50804c6f
commit
7c98f57f6c
1 changed files with 6 additions and 0 deletions
|
@ -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 ""
|
||||
|
|
Loading…
Add table
Reference in a new issue