Questions tagged [postman-mocks]

31 questions
1
vote
1 answer

How to send array of strings in query parameters of get request in postman

I have postman mock server with collection, and one of the requests has parameter with type array. Here is the definition for this query parameter in the API ymal file: - name: departureAirports required: false in: query …
Mohamed Amer
  • 429
  • 1
  • 4
  • 18
1
vote
1 answer

Postman Mock API Server - how to make it private after I already created the collection and made it public

As in the title. I have scoured the Postman documentation and went through different nooks and crannies in Postman desktop app but I am unable to make my mock api server private. I have generated a Postman API Key and I am passing it with all the…
codeepic
  • 3,723
  • 7
  • 36
  • 57
0
votes
1 answer

Postman: Generating POST request body from GET response

I generate an API and Collection for my app by applying the steps on the following article: The hidden gem: Postman API and Documentation feature. You may try by using a test endpoint e.g. https://petstore.swagger.io (user:test, pass:abc123). Here…
Jack
  • 1
  • 21
  • 118
  • 236
0
votes
1 answer

Postman Examples Dynamic Response Based on Request Data

Probably missing something completely obvious in the docs but is it possible to echo request data in a Postman Example / Mock Server response based on the input request. Example Request: POST: { "firstName": "{{$randomFirstName}}", …
Patrick Bray
  • 552
  • 2
  • 7
  • 20
0
votes
0 answers

Mock Postman request using axios is returning string instead of object

I have created a Postman mock server. I am calling the server in my web application using axios as below: const response = await axios.get(`${BASE_URL}/products`, { 'headers': { 'Content-Type': 'application/json' } }); const…
Hodaut96
  • 93
  • 1
  • 9
0
votes
1 answer

Using request data in Postman mock response

In my postman mock server I would like to use data from the request. Is this possible? I can't seem to find any reference to this scenario. For example, my request includes a documentId value. I would like to capture that value and use it in the…
toryb
  • 75
  • 1
  • 10
0
votes
1 answer

Conditioned next post cmd according to response variable

with get, I am trying to get location status from the machine by CMDs from the postman. I am sending commands for transport to defined locations. These locations have some status. This status I can get…
0
votes
1 answer

Does postman mock server can return status code 449

I try to use Postman to mock server functionality to mock an API call that will return status code 449. For some reason, the good response body is return, but the status code stays at 200. I can change the example to return 404, 422, 451, and…
0
votes
1 answer

How to create a Postman server mock for uploading file and doing some uploading test of Flutter code?

I'm trying to connect to a printer server to be able to save the printing files directly in the printer storage. I'm able to do it using the curl curl -v -H 'Content-Type:application/octet-stream'…
0
votes
1 answer

How to store a request JSON in a variable and use it in the mocked response body

I want to mock exact request values in response. ex : request body {“username”:“google”, “address” : {“city”:“CA”}, “contactNo”:“8274287844” } response should be like this : based on request i need to map exact values to same key(from request to…
var a
  • 39
  • 9
0
votes
0 answers

How to write a nested test case in postman?

For Example, if below is my response: { "rule":"1001", "fixedResponse":"101JOB0011102JOB0012" } Based on fixedResponse field value, can I create a test case like a function within a function for each job validation? pm.test("Validate…
0
votes
1 answer

Delete Postman Cookies

Is there any way to expire authtoken in postman saved after login call? I have tried to code get response object { tests["Login successfull"] = responseCode.code === 200; var token = postman.getResponseCookie("authtoken"); console.log(token) } this…
0
votes
0 answers

Calling a POSTMAN Mock Server from IIB

I have been trying to call a mock server I made on POSTMAN from IIB flow that I deployed on local. But I am getting java.net.UnknownHostException: 77735a12-4076-4e16-af64-79f0f9b70b61.mock.pstmn.io I have tested the mock server after creating it, it…
0
votes
0 answers

Assert an element from an Array in Postman

Problem in this Loop //Test to Check W2B001 is received same from API as well//Test that the response is an Int or date I have an Array like this "dates": [{ "id": 1, "date": "2019-06-30T00:00:00" }, { "id": 2, …
0
votes
0 answers

Postman Mock API not matching request with Content-Type header

I'm making a mock postman collection to use in an android app. I'm starting with a simple {{url}}/user/login endpoint and seem to be having trouble with the Content-Type header. Retrofit adds this by default as application/json; charset=UTF-8, which…
Daniel Sims
  • 531
  • 4
  • 21