Not able to hit an endpoint with variable in Postman - collections

When using an endpoint I am able to get the request done successfully and retrieve the response as well but when I use the variable in my endpoint for example: {{abc}}/api/user/id it gives status 404 not found and I have specified the variable in the collection "abc"
so not sure why is this issue is coming. Why the variable is not recognizable?
Thanks in advance.

Do you have any environment variable or local variable or data variable with same name ? These have more preference than collection so if you have same variable name then this values will over ride the collection variable value
https://learning.postman.com/docs/sending-requests/variables/#variable-scopes
In postman precedence is from down to bottom and scope is from top to bottom
Scope:
Meaning if you have global variable defined then it will be visible for all collections and environment variable will be visible only for that particular environment.
Precedence
if you have a variable with same name defined in both environment and collection then the value will be taken from environment. as precedence is collection < environment

Related

How to declare a variable that persists subroutines

During the recv subroutine I am currently changing my backend to another backend to handle the request, I need to declare a variable that will hold the value for the first/original backend that it was set to, so that when the request is restarted, I can then assign the backend back to this.
I can't just use the name for the backend and simply assign it back as I need it to be dynamic, storing it in a variable seems like the simplest solution but I can't seem to find any information on how this can be achieved through subroutines/ restarts.
If not possible are there any other solutions I could try to achieve this? Probably not possible from what I understand but even the ability to access an array of the backends defined and picking the first one would suffice, I just cant rely on naming the backend to assign it back.
Unfortunately it isn't possible to declare a variable as a BACKEND type (which is what req.backend returns).
See this 'Fastly Fiddle' example that demonstrates you'll get a compiler error of:
Expected variable type, one of: BOOL, INTEGER, FLOAT, TIME, RTIME, IP or STRING
There also isn't any way to get a list of available backends via VCL either.
Additionally you would need to hardcode the backend value (i.e. you need to explicitly know what backends are defined from the VCL perspective) as trying to store a backend into a header or variable will convert it to a STRING type representation (such as 6kLtu7NicmMs0DtKsuite9--F_origin_0).
This means even if you were able to parse the actual F_origin_0 backend from the string you wouldn't be able to assign it as a value to req.backend as that expects the value to be of type BACKEND (and VCL doesn't provide a way, AFAIK, to convert a string into that type).

global variable in optaplanner

In drools rule file how do I set the value of (or initialize) a global variable for optaplanner. My use case is following:
I want to declare a global java map that is constant and will not change during the execution. Every rule will access the map to check for a value, if value is in the map then rule will evaluate to false. The map is being generated before execution starts by accessing data in files/database.
This link https://issues.jboss.org/browse/PLANNER-94 is also requesting the access to global variable but this feature is rejected now.
How do i use the hack defined in this link: Setting global variables in working memory in Drools planner, from which object i should get CustomSolverPhaseCommand? [I am not able to comment on this post yet because i don't have enough reputation, sorry if it seems duplicate question].
I am creating SolverFactory from xml Resource and xml file contains the path to .drl file. Just like in .drl we can access object HardSoftScoreHolder scoreHolder, I want to access the map in the same way in 'then' part of rule.
can anyone please help?
Look at the examples that have a class that ends with Parameterization instead, such as ConferenceParametrization, this is probably a better alternative than globals.

Airflow Variable masked

When using a Variable named xxxx_apiKey in airflow it masks the value of the variable in the UI as expected. But when we are trying to use that variable in a DAG the value returned from:
Variable.get('xxxx_apiKey')
returns the masked value ******.
Is there a method parameter to retrieve the value unmasked?
The method you're calling should decrypt your secret when calling it. In my opinion, you've rewritten by mistake the variable and the real content now contains stars. This may happen through the web interface. Try storing again the content of this variable and see if it works now.

Why Do we use Session() state instead of global variables in ASP.NET? what is the point?

Why Do we use Session() state object in ASP.NET to store and retrieve data throughout the session of any user? Why not use global variables instead of session()....And similarly View() state to store and access data anywhere inside a page...Why this functionality exists while we can simply store the data in a Variable and access it wherever needed? Please Clarify
One of the answers I came across is that during the occurrence of Page PostBack there may be a chance that the variables might become empty and so the data in the variables will be lost. Hence why we use states for accessing data.
You can use value of session anywhere in your application and global variables can be use on a single page. Whenever page will be refreshed value of global variables becomes empty but session value will be remain as it is.
The 3 concepts Session, View State and Global objects does the same job of saving and accessing the values.
The main difference comes in stating the scope of this value assigned to the variable. Below definition will explain you the same.
1> Global variable: The scope of global variable (declared either through a singleton pattern or application state) has a application scope. i.e; the value assigned to this variable will be accessible in all the sessions and will be same at a point of time of all sessions and in all pages. These value are stored in the .NET Framework common language runtime and is same across application.
For eg: A connection string, database name etc.
2> Sessions State: The value assigned to a session state object will have a scope only for that session (until you perform a session.abondon).
For eg: when you login to a website the website might store your login Id in a session variable. This session variable will be accessible in all the pages until you log out.
3> View state: The scope of view state is the page and subsequent postbacks. Once you navigate to a different page the values are gone. This is mainly used to store a calculated values that can used after the post back. Also, ASP.net internally uses viewstate to populate the control values after postback.
View state is a page level state management.

Dynamic variable for custom component functions in Flex 4

I define a variable which is dynamicaly changes based on the user interactions, for example ID of an object sets to variable when user touches on it. After the ID sets I call a function in a custom component which is related to that object. Like this;
activeObject.videoPlay(event) ---> if the activeObject is video1 ---> video1.videoPlay(event) function will be called.
I tried several variable types when defining the variable activeObject, such as String , Array but didnt work out. By the way the data set to variable is String. When I use String type it gives this error;
Error #1061: Call to a possibly undefined method videoPlay through a reference with static type String.
Is there any way to use a string as a dynamic variable?
Is there any way to use a string as a dynamic variable?
Bracket notation -- obj["dynamicPropertyName"] as Type or in your case (activeObject['videoPlay'] as Function).apply(abc, [event]); You'll obviously want null object checks etc.

Resources