I am attempting to post to my API using robot framework Here is my code:
*** Variables ***
${FW_API} "API SERVER"
${uri} "API REPOSITORY"
${json_String}= {"FileName": "\\\\PATH", "ClientCode": "Attachments", "Template": "$::Attachments"}
*** Test Cases ***
FW_API_Post_Request
Create Session Framework_API ${FW_API}
Sleep 1s
#${body}= Create dictionary ${json_String}
${header}= Create dictionary Content-Type=application/json
${response}= Post Request alias=Framework_API uri=${uri} headers=${header} data=${json_String}
Sleep 1s
log to console ${Response.status_code}
log to console ${Response.content}
Sleep 3s
#VALIDATIONS
${res_body}= convert to string ${response.content}
When looking within my log, The body shows:
body="{\"FileName\": \"PATH\", \"ClientCode\": \"Attachments\", \"Template\": "$::Attachments\"}"
I have no clue why the additional escapes are showing up I can only assume the data is not being translated properly. I have done quite a few searches and all I have seen states I am coding this correctly. I may need to convert to JSON. But I tried that as well. Same result (400 error) due to invalid submitted data. Any assistance is greatly appreciated
Thanks