Api 如何在elm中创建动态http正文

Api 如何在elm中创建动态http正文,api,elm,Api,Elm,我正在实现这个服务,在这里我必须创建动态HTTPPOST请求,我的代码如下 postRequest: Int -> Http.Request postRequest catId = let body = """{"categoryId:"""++catId++""","coupon":false,"domainId":1,"locations":[],"onlineMenu":false,"onlineOrder":

我正在实现这个服务,在这里我必须创建动态HTTPPOST请求,我的代码如下

postRequest: Int -> Http.Request
postRequest catId = 
        let
            body =
                """{"categoryId:"""++catId++""","coupon":false,"domainId":1,"locations":[],"onlineMenu":false,"onlineOrder":false,"pageNo":1,"pageSize":10,"reservation":false,"searchText":"","subcategories":[]}"""
        in 
           {    verb = "POST"
                , headers =
                    [("Content-Type", "application/json")
                    ]
                , url = "http://xyz/businesses/list"
                , body = Http.string body
            } 
但是我得到了一些错误 如何将主体中的catId与catId连接为整数类型


请任何人提出我在实现中犯了什么错误。

正如您声明的
catId
Int
而非
String
,因此
(++):String->String->String
无法对其进行操作

在将字符串连接到字符串之前,可以使用
toString:a->String

"categoryId:" ++ (toString catId)

谢谢@Tosh的帮助!!