Skip to content
Snippets Groups Projects
Commit fdaea8b1 authored by lucien senaneuch's avatar lucien senaneuch Committed by GATEAU Thibault
Browse files

[Bug correction & Hide SSL Warnings]

parent 4c59c9b2
No related branches found
No related tags found
No related merge requests found
import requests as rq
# Disable SSL Message error
from urllib3.exceptions import InsecureRequestWarning
rq.packages.urllib3.disable_warnings()
class Nanospace:
def login(self):
......@@ -155,7 +160,7 @@ class Nanospace:
:Exemple:
nanospace._create_formula_value(28, 'value', '5*8')
"""
r = rq.post(self.ApiBaseAddress + 'formula?parentId=' + str(idParent), json={'name': valueName, 'formula': value, 'type': 'string_value'}, headers=self.headers, , verify=False)
r = rq.post(self.ApiBaseAddress + 'formula?parentId=' + str(idParent), json={'name': valueName, 'formula': value, 'type': 'string_value'}, headers=self.headers, verify=False)
r_data = r.json()
if r.status_code < 200 or r.status_code >= 300:
raise ValueError(r_data)
......
......@@ -5,8 +5,7 @@ pw = 'test'
srvAddr = 'https://dcas-nanostar.isae.fr/api/'
nanospace = Nanospace(srvAddr, usr, pw)
# print(nanospace.get_string_value(1062))
print(nanospace.get_string_value(5))
# nanospace.update__string_value(83, 'test', '1Kg5')
# print(nanospace.get_formula_value(84))
# nanospace.update_formula_value(84, 'multiplication','5*20')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment