LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-29-2015, 05:12 AM   #1
boby.kumar
Member
 
Registered: Mar 2013
Posts: 92

Rep: Reputation: Disabled
cURL utility to post http payload to invoke the API


Hi Team

I am planning to test a API through cURL to post some encrypted data to invoke the API and get the response in a file. I am herewith enclosed some steps to do this:
1.A xml file which contains some data like
<?xml version="1.0" encoding="UTF-8"?>
<IO>
<USER>
<username>abc123</username>
<PHONE>
<serialno>1234566</serialno>

</USER>

2.Encrypt the xml file using DES3 algorithm and generate the encrypted payload(UI) like:
B1A736E25B7A74DBEBAD82DF78
3. And post these UI with the pre-defined destination url along with ui payload.
4. Get the response
for ex. a complete request looks like before to post
https://dest-ip:port/user_info/getus...RTYU834JHK6768

I have found a post to encrypt the xml file using openssl with DES3 algorithm and append the ui to request.

Is this way correct to get the response? or Any other method can do the same thing

Please let me about these.

Thanks and Regards,
Boby Kumar

Last edited by boby.kumar; 10-29-2015 at 05:13 AM.
 
Old 10-29-2015, 07:32 AM   #2
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 1,691

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
That depends entirely on the service you want to access. For example, OpenStack's API works with unencrypted JSON instead of encrypted XML, and most JSON payload is in the body, not the headers. Quite different from what you are proposing.
 
Old 10-29-2015, 08:02 AM   #3
boby.kumar
Member
 
Registered: Mar 2013
Posts: 92

Original Poster
Rep: Reputation: Disabled
Yes. service we want to access support the xml format with encryption.
Question is here how to encrypt xml with the mentioned format that we would like to invoke ?
ui=AC2343B1A736E25BCDA7E5RTYU834JHK6768
 
Old 10-29-2015, 08:05 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,785

Rep: Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159
Quote:
Originally Posted by boby.kumar View Post
Hi Team
Sorry, none of us here are on your 'team'.
Quote:
I am planning to test a API through cURL to post some encrypted data to invoke the API and get the response in a file. I am herewith enclosed some steps to do this:
1.A xml file which contains some data like
<?xml version="1.0" encoding="UTF-8"?>
<IO>
<USER>
<username>abc123</username>
<PHONE>
<serialno>1234566</serialno>

</USER>

2.Encrypt the xml file using DES3 algorithm and generate the encrypted payload(UI) like: B1A736E25B7A74DBEBAD82DF78
3. And post these UI with the pre-defined destination url along with ui payload.
4. Get the response for ex. a complete request looks like before to post
https://dest-ip:port/user_info/getus...RTYU834JHK6768

I have found a post to encrypt the xml file using openssl with DES3 algorithm and append the ui to request.Is this way correct to get the response? or Any other method can do the same thing
So you've given us 'steps'...why don't you show us the actual WORK that you've done to try this??? Or is this much like several of your other threads, going back two years, where you just ask for handouts??
http://www.linuxquestions.org/questi...ux-4175480716/
http://www.linuxquestions.org/questi...pt-4175556776/
http://www.linuxquestions.org/questi...es-4175502933/
http://www.linuxquestions.org/questi...er-4175498933/
 
Old 10-29-2015, 08:41 AM   #5
boby.kumar
Member
 
Registered: Mar 2013
Posts: 92

Original Poster
Rep: Reputation: Disabled
OK TBone. I will definitely revert you with the complete task.thanks.
 
Old 10-29-2015, 09:20 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,785

Rep: Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159
Quote:
Originally Posted by boby.kumar View Post
OK TBone. I will definitely revert you with the complete task.thanks.
No idea what you mean by "revert" me with the complete task. If you mean you will actually show us what effort you've put in so far, then why didn't you do it, instead of just telling us you were going to?
 
1 members found this post helpful.
Old 11-02-2015, 08:48 AM   #7
boby.kumar
Member
 
Registered: Mar 2013
Posts: 92

Original Poster
Rep: Reputation: Disabled
Problem solved!
command should be like this(my case) for whom those like to invoke API method with string UI-
curl -v -X POST -d "SERVICE=wally&PART=part&$str1" "http://ipaddressort/info/info.do?"

Thanks TBone for the Suggestion.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php curl http post request submit with a secure connection conflicker Programming 0 06-13-2012 12:31 PM
[SOLVED] cURL POST data command from shell returns HTTP Error Code 408 fyndr Linux - Software 3 03-04-2011 09:17 AM
curl and wget http post williebens Linux - Newbie 4 10-11-2010 11:03 PM
LXer: Invoke dynamic languages with Java scripting API LXer Syndicated Linux News 0 09-05-2007 01:00 AM
HOWTO:eclipse F1 invoke context help and api lookup tacca Programming 1 03-07-2006 07:12 AM


All times are GMT -5. The time now is 12:38 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration