Forum Discussion
Chad_Roberts_21
Nimbostratus
Jan 23, 2007Quotation Marks in content of HTTP::respond
I have numerous scripts that contain the "HTTP::respond" action, and I've always been able to get around not being able to use a quotation mark in the content until now. I've got a rather long block o...
Jan 23, 2007
Why do you need to get rid of the quotation marks? If the issue is because you are setting a variable to your content and you are enclosing your variables value with quotes and the internal quotes in the data are mucking things up, then there is an easy workaround.
In TCL, you can enclose values with curly braces instead of quotes if you wish. Here's an example of storing response content in a variable and then responding with that content.
when HTTP_REQUEST {
set content {Object not found!"Object" not found!The requested URL was not found on this server. If you entered the URL manually please check your
spelling and try again.Error 404
}
HTTP::respond 404 content $content "Connection" "close"
}Here's the HTTP response from the BIG-IP.HTTP/1.0 404 Not Found
Connection: close
Server: BIG-IP
Connection: close
Content-Length: 846Object not found!"Object" not found!
The requested URL was not found on this server. If you entered the URL manually please check your
spelling and try again.Error 404
You'll note that in addition to embedded quotes, I also tested including more curly braces in the content and as long as they are evened out then the TCL interpreter should handle it.
If this is completely off target of what you were asking, let me know...
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
