Forum Discussion
Rajesh
Nimbostratus
Sep 12, 2018jason response
Hi,
There is an requirement to return a jason response message for an application contains an context (/applicationname) .. Please help how do i implement it as irule
3 Replies
- PeteWhite
Employee
use the HTTP::respond command - set the content-type to application/json and send the response. Is it always the same? If it is large then you can add it as an iFile and send that directly.
- PeteWhite
Employee
Use HTTP::respond
eg
when HTTP_REQUEST { HTTP::respond 200 -version 1.1 content { { "name": "Pete White" } } Content-Type application/json }
Note that the use of curly brackets
around content means that there will be no variable interpolation. You can also use speech marks{ }
as well.""
Lots of good examples if you get stuck.
- Rajesh
Nimbostratus
Got it Thank you..
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects