I came across this question that was asked a while back to send array data in postman (Is it possible to send an array with the Postman Chrome extension?).
My problem is though, I want to be able to access all those variables sent. Currently, I'm only receiving the first one because I say:
key=shareholder, value=100
If I try
key=shareholder[0], value=100
key=shareholder[1], value=200
or even without the indexes,then I get a NONETYPE error for shareholder
code:
request_data={
"shareholder": []
}
request_data["shareholder"].append(int(request.form.get("shareholder")))
Would definitely appreciate the help. Sorry if anything I said is unclear
To access a variable in Postman is incredibly easy. BUT, Postman is Javascript application. You need to use python nowhere with postman. Javascript is a comprehensive one.
I didn't get what kind of variable you want to access, but if you give me a clear example I will tell you how to reach any level of variable in postman
MORE INFO:
https://www.getpostman.com/docs/v6/postman/environments_and_globals/variables
Related
Just built my first Shopify store and wanted to use python and API to bulk-update product tags on all our products.
However, I've run into a snag on my PUT call. I keep getting a 400 Response with the message '{"errors":{"product":"Required parameter missing or invalid"}}'.
I've seen other people with similar issues on here but none of their solutions seem to be working for me.
Has anyone else run into this problem that can help me figure it out?
Here are some screenshots of my code, a printout of the payload, and the error in the response.
Code, Payload and Response:
I can successfully get the product info using the API and was originally sending the entire JSON payload that was returned just updated it with my product tags and sent it back through the API.
To narrow potential pain points, I'm keeping it simple now and just including "id" and "tags" in the payload but still get the same error.
We figured it out! It turns out that when we initially created the store we used a domain store name that was misspelled so we created a new domain store name with the correct spelling. However, the original domain store name was not deleted (not even sure it can be), and even though the new domain store name forwards to the original one and allows for GET requests, for PUT requests we had to use the original misspelled domain store name and the PUTs work fine.
I figured this out by using fiddler to capture a manual product update via the Shopify website to see what the payload looked like and that's why I noticed the store URL was different than the one we were using.
Hope this helps someone with a similar issue!
I am a little baffled with the issue I am facing with Zobot. I have developed a Zobot in which I am using visitorsession to store some values and reuse them later. It works great in Zoho Developer environment, we used Deluge scripts option to do the development.
But when I deploy it using embed script on my website, the visitorsession part of the code is returning null. I searched around and found not a single person facing this issue or posting it, I am really surprised its happening only to me. Can someone please suggest what I should do. I have explained what I am facing below:
I am storing values like this
storeResponse2 = zoho.salesiq.visitorsession.set(portal_name,{"a":"b"});
I am getting the values like this
zoho.salesiq.visitorsession.get(portal_name,"a").get("data").get("a");
It is working great in Zobot Development environment in the Preview section, but when I go to my website where I put the embed, I am getting null.
In both environments, the response I get when I do the set is the same. Its not throwing any error, it is giving me valid response. The response I am getting when I set, in both environments is:
{"url":"/api/v2/bigtalk/visitorsessions","object":"session","data":{"a":"b"}}
But when I do a get, in Zoho environment I get correct value, in production I get null
Attachments area
If this happens, it probably means that you are setting and getting the data from visitorsession in the same execution.
It doesn't work that way. It should be set in one execution and get in further executions (replies). And this won't be a problem anyway, as in the same execution, you'll have the data available already.
I am calling a web API in Python, getting data back in XML, converting the response into a dictionary using xmltodict, but for several elements, sometimes I get a dictionary (single element) and sometimes I get a list (multiple elements) in response.
I first started to use "if isinstance(..., dict):" - that could solve my problem but is not so elegant and requires quite some lines of code in my case.
I then found out "force_list" which I think is exactly what I need, but I need to apply it to several elements and I can't find the right syntax - I'm not even sure if that's possible.
The code I am trying to make work:
response = xmltodict.parse(xml, force_list=({'Child'},{'Brother'}))
With force_list={'Child'} only, the code works as expected.
With the above code, I do not get any error message but when checking the result with the "type" function, I still have dictionaries where I would expect to get lists.
I tried other syntax and got error messages.
I think I found the right syntax (it seems to be working as I expected):
response = xmltodict.parse(xml, force_list=('Child','Brother'))
Just posting in case anyone would look for the same answer in the future.
I'm trying to make a cms with Python to post new targets to a cloud database on vuforia. I found this Python library "python-vuforia" but it has read functionalities only.
I added a function to post targets but so far getting 401 error. you can find the new function in this commit
What am I doing wrong?
Got it working with this (commit)[https://github.com/dadoeyad/python-vuforia/commit/1997a49f94c5f2e13ab1d5c620c69160c76b7969]
I think the problem was with doing str(req.get_data()) instead of req.get_data()
and base64.b64encode(hmac(key, message, sha1).digest()) instead of hmac(key, message, sha1).digest().encode('base64')
i have found on StackOverflow and manage to use a skeleton proxy based on twisted, but i wonder if it can help me to solve my problem :
i would like to be able to remember the dependencies bewteen the data that pass through this proxy, (i'am new to this network behaviour and not know how to do it) that is i would like to be able to determine that this particular ajax answer is following i call made by this javascript which was itself loaded from this url/html page and so on.
is it possible ?
(as another example, i would like to be able to record/log in a similar way as the tree structure that is available when using Firebug, so that the proxy can log and say "i was first asked to go to this url", then, i see "this particular xyz.js file" and "this azerty.css" both where loaded as they depended on "this first url". Another example is for Ajax answer/response being able to tknow that it is linked to the initial page url page.à
(an so on, on a eventually recursive basis... asked in another I mean i need to determine which are the external files/data/ajax response loaded after by the initial html page passing through the proxy.)
can i do this kind of tracing from a proxy based on twisted ?
maybe i am wrong by thinking that a proxy can be able to do this without parsing/understanding the complete initial url. IF so my trouble wil lbe that i must handle Javascript and thus be able to parse and executing it :/
thanks
first edit : removing my attempts as asked. Sorry i have some difficulties in my question because i am not an expert in internet communication.
EDIT : Following Monoid comment, is it at least possible to be able to pair a particular Ajax answer with a javascript file or call from the proxy point of view ?