Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8827013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:16:54+00:00 2026-06-14T07:16:54+00:00

my question is quite hard to describe, so I will focus on explaining the

  • 0

my question is quite hard to describe, so I will focus on explaining the situation. So let’s say I have 2 different entities, which may run on different machines. Let’s call the first one Manager and the second one Generator. The manager is the only one which can be called via the user.

The manager has a method called getVM(scenario_Id), which takes the ID of a scenario as a parameter, and retrieve a BLOB from the database corresponding to the ID given as a parameter. This BLOB is actually a XML structure that I need to send to the Generator. Both have a Flask running.

On another machine, I have my generator with a generateVM() method, which will create a VM according to the XML structure it recieves. We will not talk about how the VM is created from the XML.

Currently I made this :

Manager

# This method will be called by the user
@app.route("/getVM/<int:scId>", methods=['GET']) 
def getVM(scId):
    xmlContent = db.getXML(scId)  # So here is what I want to send
    generatorAddr = sgAdd + "/generateVM"   # sgAdd is declared in the Initialize() [IP of the Generator]

    # Here how should I put my data ? 
    # How can I transmit xmlContent ? 

    testReturn = urlopen(generatorAddr).read()
    return json.dumps(testReturn) 

Generator

# This method will be called by the user
@app.route("/generateVM", methods=['POST']) 
def generateVM():
    # Retrieve the XML content...
    return "Whatever"

So as you can see, I am stuck on how to transmit the data itself (the XML structure), and then how to treat it… So if you have any strategy, hint, tip, clue on how I should proceed, please feel free to answer. Maybe there are some things I do not really understand about Flask, so feel free to correct everything wrong I said.

Best regards and thank you

PS : Lines with routes are commented because they mess up the syntax coloration

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:16:55+00:00Added an answer on June 14, 2026 at 7:16 am

    unless i’m missing something couldn’t you just transmit it in the body of a post request? Isn’t that how your generateVM method is setup?

    @app.route("/getVM/<int:scId>", methods=['GET']) 
    def getVM(scId):
        xmlContent = db.getXML(scId)  
        generatorAddr = sgAdd + "/generateVM"   
    
    xml_str = some_method_to_generate_xml()
    data_str = urllib.urlencode({'xml': xml_str})
    urllib.urlopen(generatorAddr, data=data_str).read()
    return json.dumps(testReturn) 
    

    http://docs.python.org/2/library/urllib.html#urllib.urlopen

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It quite hard question to ask but I will try. I have my 4
I'm not really pro and find my question quite hard to describe, so please
This question is quite hypothetical but I'll ask anyway. Let's say you start a
So I have a strange and quite ambiguous question, which I can't seem to
This might be a simple question for some people since it was quite hard
This is a very basic question...quite embarassing, but here goes: I have a Stopwatch
The question is quite simple : I have a controller plugin for Zend Framework.
I have seen the reverse of this question quite a few times, but have
It's quite hard to explain in question title, however what I want to achieve
This sounds like a trivial question, but it's proved quite hard to google anything

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.