http-request-context-items
Service icon

HTTP Request Context Items

Stable version 1.0.1 (Compatible with OutSystems 11)
Uploaded
 on 3 Feb
 by 
0.0
 (0 ratings)
http-request-context-items

HTTP Request Context Items

Details
Expose the key/value collection HttpContext.Items during an HTTP request. https://learn.microsoft.com/en-us/dotnet/api/system.web.httpcontext.items
Read more
  • Scoped to the Current Request:
    • The Items collection is specific to a single HTTP request and exists only for the duration of that request.
    • Once the request is complete, the data in the Items collection is discarded.
  • Stored In-Memory on the Server:
    • The Items dictionary resides in memory on the server as part of the HttpContext object. It is never sent to the client and is not persistent across requests.
  • Designed for Temporary, Per-Request Storage:
    • It is useful for storing and sharing data within the context of a single HTTP request, particularly between middleware, handlers, or components that process the request.


Use cases

  • Set dynamic configuration values to be able to retrieve those in the same Server Request, like:
    • Get those in OnAfterRequest callback to Refresh the IdP Token. (Since isn't possible to pass dynamic attribute)
    • Keep "Cookies" updated. 
      • If you update an cookie, and try to get it again inside of the same Server Request, you will notice that contains the old value.
      • This can help you maintain the updated value inside of the Server request, until it sync with the browser at the end of the same.
      • This is very case specific.
  • Edit existing collection values. (Advanced)
  • Etc... (Didn't explore more use cases, but certainly they exist)
Release notes (1.0.1)
  1. "AddItem" can now be run twice, without exception.
  2. "GetItem" no longer returns '-undifined-' when no value was set before, but rather just "".
License (1.0.1)
Reviews (0)
Team
Other assets in this category