LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-08-2010, 04:50 AM   #1
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Rep: Reputation: 79
wget sent edited xml as post data


Hi all,

To make an rpc call I need to sent an xml file as post data.
I know how to do this with wget. It works fine when I have the xml already filled in (depending on the node values the response from the call is different).

However I want to be able to edit part of this file, and then sent that as post data using wget.

I can edit this file using sed (I dont want to rewrite the files each time this gets used; and it does get used alot, with alot of different values).

Is there some way I can use a HERE document? And what about escaping all the xml code?

Thanks in advance
 
Old 07-09-2010, 07:28 AM   #2
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Original Poster
Rep: Reputation: 79
I fixed it using a HERE document like this:

Code:
myval=foo
xmlcall=`cat <<XMLCA
<tag1>
<tag2>$myval</tag2>
</tag1>
XMLCA`

wget --post-data="$xmlcall" http://theurl
So this is solved
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How To get the data from a tag in XML File kingmaker2003 Programming 7 12-04-2008 11:12 PM
xml - character data location abolishtheun Programming 1 04-06-2008 04:00 PM
How can I post data with POST method in C programming. haxpor Programming 24 04-11-2007 08:34 AM
wget/curl problems. redirection after post method tommmmmm Linux - Software 1 08-10-2005 10:36 AM
XFCE4 Menu.xml? could anyone post theirs? nikd Linux - Software 1 05-07-2004 10:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration