I am trying to create an application where an url is specified along with the number of closest matches (integer) to the content of that url. I have made a google cloud function which calculates this for a given link in the database. When running a similar request in python 3.7 using the requests package a json with the closest matches is returned but in anvil i keep getting the error: invalid json in response…
Can somebody help me?
form button
def searchsim_click(self, **event_args):
urltext = str(self.url.text)
ntext = int(self.n.text)
table = {'url':urltext, 'n':ntext}
resp = anvil.server.call('calculate_similarity', table)
pass
server module
import anvil.server
import json
@anvil.server.callable
def calculate_similarity(table):
table = json.dumps(table)
print(json.dumps(table))
resp = anvil.http.request("GCP link",
json = table, method = "POST")
return resp