Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

What is wrong with this xml format ?

What is wrong with this xml format ?

What is wrong with this xml format ?

I have a python script that loads a pdf converts it to base 64 and puts it into an xml and makes a POST Request to a link.

With my XML formatting I get 400 code Bad Request.

This is my XML, is it something wrong ? Am I missing something ?

xml = """<header xmlns=\"mfp:anaf:dgti:spv:reqUploadFisier:v1\"
<upload fisier=\"" +"""+b64+"""+ "\"/>\

The three quotes mean multi line in Python

Thanks in advance

RE: What is wrong with this xml format ?


That does not really look like syntactically valid XML. Better double check those triple quotes :

CODE --> SerbanC.py

b64 = 'U2VyYmFuQw=='

xml = """<header xmlns=\"mfp:anaf:dgti:spv:reqUploadFisier:v1\"
<upload fisier=\"" +"""+b64+"""+ "\"/>\

print xml 

CODE --> command line

bash-5.0$ python SerbanC.py
<header xmlns="mfp:anaf:dgti:spv:reqUploadFisier:v1"
<upload fisier="" +U2VyYmFuQw==+ ""/></header> 
So far this looks more like a question for forum278: Python.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close