Question: How do I create different success.json based on a param?
See original GitHub issueI have not yet figured this one out and need help.
Folder structure:
test#{id}
test#{id}/GET
test#{id}/GET/mock
Example: Call: /rest/test/1 Response should be:
{
"id": 1,
name: "John"
}
Call: /rest/test/2 Response should be:
{
"id": 2,
name: "Sven"
}
Edit. Also i don’t figure out how to show error.json if no ID is supplied when doing the GET.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to create, and handle parameters and success response ...
//now create the URLRequest object using the url object var ... httpBody = try JSONSerialization.data(withJSONObject: params, options: .
Read more >How To Work with JSON in JavaScript - DigitalOcean
This tutorial provides an introduction to working with JSON in JavaScript. Some general use cases of JSON include: storing data, ...
Read more >Response.json() - Web APIs - MDN Web Docs
The json() method of the Response interface takes a Response stream and reads it to completion. It returns a promise which resolves with...
Read more >JSON - Quick Guide - Tutorialspoint
JSON - Quick Guide, JSON or JavaScript Object Notation is a lightweight text-based open standard designed for human-readable data interchange.
Read more >JSON:API — Latest Specification (v1.1)
A client MAY use the profile media type parameter in an Accept header to request that the server apply one or more profiles...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
And as a feature request it would be cool if you could use different success files for different params. Like success{id}.json and the you name the files success1.json, success2.json, and so on!
Thank you! That’s awesome!