我的api形式如下:
override func viewDidLoad() {
super.viewDidLoad()
initialLabelCenter = labelSliderValue.center.x
}
//Set value of slider into label from 100 to 1000
@IBAction func sliderActionValueChanged(_ sender: UISlider) {
let currentValue: CGFloat = CGFloat(sender.value)
labelSliderValue.text = String(describing: currentValue)
//Returns the drawing rectangle for the slider’s track
let trackRect = sliderInstance.trackRect(forBounds: sliderInstance.bounds)
//Returns the drawing rectangle for the slider’s thumb image.
let sliderThumbRect = sliderInstance.thumbRect(forBounds: sliderInstance.bounds, trackRect: trackRect, value: sliderInstance.value)
//Set label's center to move in a particular direction. In this case it will move left to right horizontally
labelSliderValue.center = CGPoint(x: initialLabelCenter + sliderThumbRect.origin.x, y: self.labelSliderValue.center.y)
}
目前,我刚刚在我的映射模板中定义了https://<>.execute-api.us-east-1.amazonaws.com/Testing/api/v1/mobs/<>.json?filename=<>.json&assertion=1
,如下所示:
.../mobs/<>.json
现在,我在网址中添加了{
"mob_type": "$input.params('type')"
}
和filename
的查询参数。那么,我如何在Body Mapping Template中定义它们呢?
这不起作用:
assertion
答案 0 :(得分:2)
在“URL查询字符串参数”下的“集成请求”中,您需要添加
的映射通过映射,可以在Body Mapping Templates中访问它们。