Updating JSON VS with V3 API using JSON request creates REST Data Protocol in the VSM
search cancel

Updating JSON VS with V3 API using JSON request creates REST Data Protocol in the VSM

book

Article ID: 396047

calendar_today

Updated On:

Products

Service Virtualization

Issue/Introduction

When updating the Virtual Service (VS) (request file: POST /basepath/fr?Accounts_0_account_number=AA11111), the system behaves as expected, correctly interpreting the Data Protocol as JSON. However, when there is a change in argument (request file: POST /basepath/en?Accounts_0_account_number=AA11112), the system incorrectly assumes the Data Protocol is REST. This leads to an unexpected update process for the VS, deviating from the intended behavior.

Environment

All supported versions

Cause

"Content-Type” header of “application/json” not included in the Request and Response files. 

Resolution

Adding  "Content-Type: application/json " and the proper headers to the RR pair files resolved the issue.

here is the sample

Json Request txt file

POST /echo/post/json HTTP/1.1
Content-Type: application/json

 

Json Response txt file

HTTP/1.1 200 OK
Content-Type: application/json

{
  "name": "John Doe",
  "age": 30,
  "email": "[email protected]"
}