Jump to content

supertwister

Members
  • Posts

    1
  • Joined

  • Last visited

supertwister's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Hi All,I'm developing a basic website and have a question. Hope it's not too much basic. I'm new in web stuff.I have the following code: $.ajax({url: '/blabla/yadayada'type: "get",success:function(data, testStatus, jqXHR){.........},error: function(jqXHR, testStatus, errorThrown){alert('error')}}); In addition, i have the following Python code: class AfCont(object):def __init__(self, target, context):self.target_server = targetself.context = contextself.baseContext = "/MyApp%s" % ( ("-" + self.context) if self.context else "")print "Starting %s with server: %s " % (self, self.target_server)def general_url(self, url_sfx):headers = {"Accept": "application/json"}params = Nonethe_url = "%s/%s" % (self.baseContext, url_sfx)print "%s %s %s " % (self, self.target_server, the_url)conn = httplib.HTTPConnection(self.target_server, "8080")conn.request("GET", the_url, params, headers)response = conn.getresponse()theResp = response.read()return theResp@cherrypy.exposedef bla_yada(self):htmlText = self.general_url("blabla/yadayada")return htmlText As you can see in the Ajax code, my URL is /blabla/yadayada. However, i need to send GET requests to /blabla/yadayada/number. I want to control the number part with a parameter. For example: number = 150 -- > `/blabla/yadayada/150`number = 9595-- > `/blabla/yadayada/9595` Can someone help me with that? Hope i was clear enough.
×
×
  • Create New...