Is there any way I can gain access to the object that implements IHttpRequest so that I can eventually get the HttpServletRequest object?

I'd like to be able to read HTTP-Headers from within the application (I'm not talking about GET or POST parameters, I want the HTTP Headers). The ivy.request object only enables me access to the GET parameters.

asked 26.11.2014 at 14:23

ahatius's gravatar image

ahatius
(suspended)
accept rate: 0%

edited 26.11.2014 at 14:25


You can cast the ivy.request to a IHttpRequest. Be careful not every ivy.request is a IHttpRequest! For example if you are running in system task the ivy.request is not a IHttpRequest.

IvyScript Example:

import ch.ivyteam.ivy.request.IHttpRequest;

if (ivy.request instanceof IHttpRequest)
{
    IHttpRequest httpRequest = ivy.request as IHttpRequest;
    httpRequest.getHttpServletRequest().getHeader("blah");
}
link

answered 26.11.2014 at 16:42

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.9k202857
accept rate: 74%

Thanks, works just as expected.

(27.11.2014 at 07:53) ahatius ahatius's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×27

Asked: 26.11.2014 at 14:23

Seen: 2,246 times

Last updated: 27.11.2014 at 07:53