Skip to content
Snippets Groups Projects
Commit 82be8476 authored by Kenny Gao's avatar Kenny Gao
Browse files

Added version header

With all formats, there is now a 'X-Metobs-API-VERSION=1.0.0'
header with he results
parent 952cfd1e
Branches
No related tags found
1 merge request!2Order form
......@@ -192,6 +192,7 @@ def asciiReturn(frame, sep, symbols, site, inst, epoch):
output.write('# status: success<br># code: 200<br># message:<br>')
output.write('# num_results: ' + str(len(dates)) + '<br>')
output.write('# X-Metobs-API-VERSION=1.0')
data = list(frame.iterrows())
......@@ -222,6 +223,7 @@ def jsonReturn(frame, symbols, site, inst, jsonFormat, epoch):
output['message'] = ''
output['code'] = 200
output['num_results'] = str(len(list(frame.columns.values)))
output['X-Metobs-Api-Version'] = 1.0
package = {}
......@@ -281,6 +283,8 @@ def xmlReturn(site, inst, frame, symbols, sep, epoch):
head.setAttribute('code', '200')
head.setAttribute('message', '')
head.setAttribute('num_results', str(len(timeStamps)))
head.setAttribute('X-Metobs-API-VERSION', 1.0)
head.setAttribute('seperator', sep)
doc.appendChild(head)
......
......
......@@ -122,6 +122,7 @@ def asciiReturn(frame, sep, symbols, epoch):
output.write('# status: success<br># code: 200<br># message:<br>')
output.write('# num_results: ' + str(len(dates)) + '<br>')
output.write('# X-Metobs-API-VERSION=1.0')
data = list(frame.iterrows())
......@@ -154,6 +155,7 @@ def jsonReturn(frame, symbols, jsonFormat, epoch):
frame = frame.transpose()
output['num_results'] = str(len(list(frame.columns.values)))
output['# X-Metobs-API-VERSION'] = 1.0
package = {}
......@@ -213,6 +215,7 @@ def xmlReturn(frame, symbols, sep, epoch):
head.setAttribute('code', '200')
head.setAttribute('message', '')
head.setAttribute('num_results', str(len(timeStamps)))
head.setAttribute('# X-Metobs-API-VERSION', 1.0)
head.setAttribute('seperator', sep)
doc.appendChild(head)
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment