You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 17, 2017. It is now read-only.
# HTTP Client for Python
import requests
# Standard JSON library
import json
# Basic Setup
PORT_NUMBER = 8888
BASE = 'http://localhost:' + str(PORT_NUMBER) + '/v1/'
# Header for posting data to the server as JSON
HEADERS = {'Content-Type': 'application/json'}
# Define dictionary of empty network
empty_network = {
'data': {
'name': 'I\'m empty!'
},
'elements': {
'nodes': [],
'edges': []
}
}
res = requests.delete(BASE + 'networks', headers=HEADERS)
print(res.text)
res = requests.post(BASE + 'networks?collection=My%20Collection',
data=json.dumps(empty_network),
headers=HEADERS)
new_network_id = res.json()['networkSUID']
print('Empty network created: SUID = ' + str(new_network_id))
# the only difference between this post request and last one, its the collection name.
res = requests.post(BASE + 'networks?collection=Your%20Collection',
data=json.dumps(empty_network),
headers=HEADERS)
new_network_id = res.json()['networkSUID']
print('Empty network created: SUID = ' + str(new_network_id))
The second collection name override the first one, so the result is one collection 'Your Collection' with 2 network, instead of 2 collections, each with a network.
change the position of the two post get different result.
I think this is a bug. Could anybody take a look at it? Thanks.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The second collection name override the first one, so the result is one collection 'Your Collection' with 2 network, instead of 2 collections, each with a network.
change the position of the two post get different result.
I think this is a bug. Could anybody take a look at it? Thanks.
The text was updated successfully, but these errors were encountered: