RF语句:${response} Post On Session query ${uri} headers=${dict} data=${data}
期望的body是{"username": "tony", "age": "11"}
但是实际发出的却不是json,而是 body=username=tony&age=11
Post Request 是正常的,却被废弃了。。
[ WARN ] Keyword 'RequestsLibrary.Post Request' is deprecated. Please use `POST On Session` instead.
POST on Session的用法介绍,乍看起来没问题:
data can be a dictionary, list of tuples, bytes, or file-like object. If you want to pass a json body pass a dictionary as json parameter.
-------------冷静的分割线---------------
仔细一看,json body 需要用json参数!
${response} Post On Session query ${uri} headers=${dict} json=${data}
这样就正确了。。