0

I need to post some values to a REST service. I'm using POSTMAN rest client for my test and i can post string, integer, boolean values to rest service there is no problem. But i could not post array values ;

I am using this parameter, this parameter is working except Array values ;

{
"parameters": [
    {
      "type": "string",
      "name": "nameandsurname",
      "value": {"string":{ "value": "myname"}}
    },
    {
      "type": "Array/string",
      "name": "arrayvariable",
      **"value": {"string":{ "value": "value1"}}** This line is not working...
    }
  ]
}
8
  • Do you expect an attribute called string in your JSON model in the backend? I mean this JSON is valid but what is your expected JSON format? Commented Mar 27, 2017 at 8:30
  • backend attribute is array of string. ı want to post array item value to my array attribute. Commented Mar 27, 2017 at 9:02
  • What's this array name? Commented Mar 27, 2017 at 9:06
  • in this sample the name is "arrayvariable" Commented Mar 27, 2017 at 9:09
  • So you need to name it accordingly in your JSON, change it from "value": {"string":{ "value": "myname"}} to "value": {"arrayvariable":[ "value": "myname"}] also use [] for array instead of {}. Commented Mar 27, 2017 at 9:13

1 Answer 1

1

In Postman you can post JSON this way:

  1. Select method POST
  2. In section Body choose raw and content-type JSON(application/json)
  3. Paster your JSON into Body

You can download this export from Postman and try it https://www.dropbox.com/s/ulmoc8n8gmgb076/tests.postman_collection.json?dl=0

Sign up to request clarification or add additional context in comments.

1 Comment

hi zelenyjan, you had been sent to me the same parameters, "value": {"string":{ "value": "value1"}} is not working

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.