Sending a CURL command

I know this is a bit obscure but I thought it would be pretty straightforward. The curl command I need to execute is
[my_user_name]:[my_password] -H "API-TOKEN: [api_token]" -H "API-VERSION: 0.1" https://domainOfInterest.com/api"
Given my very little curl experience, I came up with something along the lines of:
private var loader : HTTPURLLoader;
                    private var END_POINT : String = "[myDomainOfInterest]";
                    private var user : String = "[userName]";
                    private var password : String = "[myPassword]";
                    private var token: String = "[myToken";
  private function loadURL() : void {
                              var request : URLRequest = new URLRequest();
                              request.url = END_POINT;
                              var variables:URLVariables = new URLVariables();
                              variables.user = userName;
                              variables.password = myPassword;
                              var myToken : URLRequestHeader = new URLRequestHeader( "API-TOKEN", token );
                              request.requestHeaders.push( myToken );
                              var APIVersion : URLRequestHeader = new URLRequestHeader( "API-VERSION", "0.1" );
                              request.requestHeaders.push( APIVersion );
                              request.data = variables;
                              try {
                                        loader.load( request );
                              } catch ( error : SecurityError ) {
                                        Logger.error( "A SecurityError has occurred." );
I am not receiving any bad info (like unauthorized, which I was for awhile) but the data coming back is empty. Is the general form of what I'm trying to do correct?

In case anyone runs into this, I was able to solve my problem by adding one more request header
var JSONHeader : URLRequestHeader = new URLRequestHeader( "Accept", "application/json" );
BTW, since ActionScript doesn't support custom request headers with GET, I used
https://code.google.com/p/as3httpclient/

Similar Messages

  • Help protect my Linksys WRT54G from the "curl" command which bypasses my security settings

    It's way too easy to break into my Linksys WRT54G router!
    Do you have firmware that will fix this vulnerability?
    Instantly bypassing the administrator password, my fifteen-year old
    neighbor broke into my Linksys WRT54G router (firmware revision v1.0.0.6)
    in ten seconds simply by sending this one "curl" command to it via the
    Internet from his home next door!
    c:\> curl -d "SecurityMode=0&layout=en" http://192.168.0.1/Security.tri
    This kid was kind enough to knock on my door today to tell me to fix it.
    I invited him in, and from inside my own house, he showed me the Linksys
    WRT54G command above which immediately disabled all my wireless security
    WITHOUT him having to enter any password!
    He showed me how to disable remote administration but he said the
    vulnerability still exists until I get a new router. I can't believe
    everyone with a Linksys WRT54G router is throwing it in the garbage.
    Where/how can I find a firmware update that protects me from this curl
    vulnerability?

    To protect your router:
    * disable remote management.
    * enable WPA2 or WPA with a strong preshared key on the router.
    That is essentially all you must do. This protects against the curl problem (from the outside). The benefits of the rest varies:
    * set a strong, hard to guess password on the router.
    That's always a good idea to prevent some guest coming over, plugging into your network and modifying the router. For that to be relevant the person either needs physical access to your wired LAN or the WPA key.
    * disable UPnP
    Good idea if you are worried you could install some malware on your computer. UPnP allows to set port forwardings for incoming connections from the internet. It allows a computer to automatically setup the forwarding to make a server accessible in the internet. You'll often need this for gaming. But it obviously can be exploited by malware.
    * access server to https instead of http
    With WPA in place on the wireless this is only really necessary if you worry about someone gaining physical access to your router. https protects the password transmission to the router. But then, if someone gains physical access to my router I think the protection of my password would be the least of my problems.
    * disable wireless access to the router configuration
    For this to be effective with WPA in place would require the attacker to crack WPA to get into your WLAN. WPA is considered secure at this time. Anyone cracking WPA with a strong key must have a lot of computing power and a lot of knowledge. I don't know if this setting would really prevent that attacker of gaining full access to the router. This setting may be useful if you have an occasional guest to which you grant wireless access to the internet...
    * changing the default IP address from 192.168.1.1 to something else and turning off the DHCP server on the router
    With the DHCP server in place changing the IP address is no mean of protection because the DHCP server assigns a correct IP address in your LAN. You have to setup static IP addresses on all computers and devices. However, if someone gained access to your LAN (wireless or wired) all you have to do is wait and listen to the LAN traffic. It usually takes a few seconds until some noisy windows computer will broadcast a message and you have picked up the IP addresses in the LAN
    Some more things often mentioned with questionable benefits:
    * turn off SSID broadcast
    Supposed to make the WLAN "invisible". O.K. It does make it harder for the average Joe to check what WLANs are in the neighborhood and which channels they use to optimize the choice of channels and limit interference. It does also prevent accidental connection attempts. However, with WPA/WPA2 in place the WLAN is protected anyway. Anyone, who really wants to know if there is a network can scan with a wireless card in monitor mode. The SSID is transmitted unencrypted. Plus in average it requires more times and more power (on laptops) to connect to the network as the wireless card must actively try to connect to each configured WLAN on the computer to find out if the network is there or not. With SSID broadcast it simply scans for broadcasts and then knows the network is there...
    * wireless MAC address filtering
    Supposed to limit the computers which can connect to the WLAN. Only computers with the MAC address on the list can connect. Again, this only prevents accidental connection attempts. MAC addresses are transmitted unencrypted. It is easy to pick them up with a wireless scanner. Thus, for anyone who knew how to crack WPA the MAC address filter list will be the least of problems. Most wireless cards can be configured with any MAC address you like. But the list increases the amount of effort for you to add another wireless computer to your WLAN as you always have to remember to set it up correctly...

  • Fatal Error Acrobat failed to send a DDE command

    Hello all.  I have a fillable form I developed using word 2010.  I am trying to convert it to a PDF form.  I open acrobat and select star from wizard from the Forms menu.  I browse to find the word document and open it.  I save the PDF document and everything looks good.  I get a progress bar that says "Please wait, reading Adobe PDF".  This is very slow progress and then I get the Fatal Error message "Acrobat Failed to send a DDE command".  I click ok and the progress bar continues still very slowly.  I get the same message again.  I click ok and the progress bar continues.  The progress bar gets to the end and just stays there.  Nothing happens.  I waited for an hour and then cancelled it. When clicked cancel, the PDF document opens with my form but without any fillable fields or drop down menus.  I tried to do it again a few times and I get the same error message.   I am using Adobe Acrobat 9 pro version 9.4.2.  Thank you in advance for your help.
    Gonzalo
     

    AA 9 will not work for anything but the print function from WORD 2010. The only version of Acrobat that is compatible with OFFICE 2010 for PDF Maker is AA X. Thus, open WORD and print to the Adobe PDF printer. Then open the pdf in Acrobat. Go to FORMS>Add or Edit fields. Since you have no fields at present, Acrobat will ask if you would like to detect form fields. Answer yes and you will get a first cut at the form fields. Yes, you will likely have to add some more and change the ones that Acrobat estimates, but you are on your way.
    The other two options you have is to go back to WORD 2007 or earlier or upgrade to AA X (or find someone with AA X and WORD 2010). These methods are pretty much your options with the software combination that you have.

  • How can I send multiple string commands into a VISA write?

    Hi Fellow LabVIEW users
    I am very new to LabVIEW (2.5 months) so please forgive me if my lingo is not up to par.
    How can I send multiple string commands to a VISA write. For example each string command looks like this
    1) 3A00 0000 0000 FFFF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0033 (Scenario 1)
    2) 3A01 0000 0000 FFFF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0034 (Scenario 2)
    3) 3A01 0000 0000 33FF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0067 (Scenario 3).
    and so on and so forth. And there are a number of scenarios.
    Each String scenario will give a different string output which will be interpreted differently in the front panel.
    Right now I have to manually change the string commands on the front panel to give me the desired output. How can I do this without manually changing the commands i.e. hard coding each scenario into the block diagram?
    Thanks, any feedback will help.
    mhaque

    Please stick to your original post.

  • Running curl command from a java program using Runtime.getRuntime.exec

    for some reason my curl command does not run when I run it from within my java program and errors out with "https protocol not supported". This same curl command however runs fine from any directory on my red hat linux system.
    To debug the problem, I printed my curl command from the java program before calling Runtime.getRuntime.exec command and then used this o/p to run from the command line and it runs fine.
    I am not using libcurl or anything else, I am running a simple curl command as a command line utility from inside a Java program.
    Any ideas on why this might be happening?

    thanks a lot for your response. The reason why I am using curl is because I need to use certificates and keys to gain access to the internal server. So I use curl "<url> --cert <path to the certificate>" --key "<path to the key>". If you don't mid could you please tell me which version of curl you are using.
    I am using 7.15 in my system.
    Below is the code which errors out.
    public int execCurlCmd(String command)
              String s = null;
              try {
                  // run the Unix "ps -ef" command
                     Process p = Runtime.getRuntime().exec(command);
                     BufferedReader stdInput = new BufferedReader(new
                          InputStreamReader(p.getInputStream()));
                     BufferedReader stdError = new BufferedReader(new
                          InputStreamReader(p.getErrorStream()));
                     // read the output from the command
                     System.out.println("Here is the standard output of the command:\n");
                     while ((s = stdInput.readLine()) != null) {
                         System.out.println(s);
                     // read any errors from the attempted command
                     System.out.println("Here is the standard error of the command (if any):\n");
                     while ((s = stdError.readLine()) != null) {
                         System.out.println(s);
                     return(0);
                 catch (IOException e) {
                     System.out.println("exception happened - here's what I know: ");
                     e.printStackTrace();
                     return(-1);
         }

  • To send multiple operation commands to serial port

    My AC power source is able to communicate to PC via serial port using LABView and I can perform any operation by giving commands in Hex individually, But when it comes to the parallel operation of all the commands or to put them in a particular sequence. I am failing to do so.

    You can only send 1 command at a time.  That is just bus communications 101.  But you can string together many VISA Writes to send the individual commands, one after the other.
    But since if sounds like you are doing this on a GUI based instance, what you want to do is configure the port before your loop and close the port after the loop.  Then inside your loop you just have an Event Structure to key off of the different controls changing values.  You just send the command you need to inside of each event case.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions

  • Why is the "Send to iDVD" command missing from the share menu in iPhoto 9.4.3 when trying to send a slideshow to iDVD?

    How come the "Send to iDVD" command is missing from the share menu? In iPhoto I used to be able to send my slideshows to iDVD simply my clicking on the slideshow, selecting the "Share" menu at the top and going to "Send to iDVD". Now in iPhoto 9.4.3 that option is missing.
    Further i am also using iDVD 7.1.2 and running OSX version 10.8.3.
    Thanks!

    Export the slideshow via the Export button at the bottom of the slideshow window with Size = Medium or Large.
    Open iDVD, choose a theme and drag the exported movie file to the menu window being careful to avoid any drop zones.
    Follow this workflow to help ensure the best quality video DVD:
    Once you have the project as you want it save it as a disk image via the  File ➙ Save as Disk Image  menu option.  This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image and launch DVD Player and play it.  If it plays OK with DVD Player the encoding was good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    OT

  • Acrobat X Pro does not open, gives fatal error - "Acrobat failed to send a DDE command"

    Acrobat X Pro does not open and gives fatal error - "Acrobat failed to send a DDE command"
    It either does the above or the application starts and is listed in the system processes but never physically opens on the desktop for viewing.

    AA 9 will not work for anything but the print function from WORD 2010. The only version of Acrobat that is compatible with OFFICE 2010 for PDF Maker is AA X. Thus, open WORD and print to the Adobe PDF printer. Then open the pdf in Acrobat. Go to FORMS>Add or Edit fields. Since you have no fields at present, Acrobat will ask if you would like to detect form fields. Answer yes and you will get a first cut at the form fields. Yes, you will likely have to add some more and change the ones that Acrobat estimates, but you are on your way.
    The other two options you have is to go back to WORD 2007 or earlier or upgrade to AA X (or find someone with AA X and WORD 2010). These methods are pretty much your options with the software combination that you have.

  • Tcp/ip write help - need to send a motor command with parameters

    hello - i have one small, main labview 7.0 vi that i use to control a drill's two motors.
    right now i press a button on the front panel to move the motor, and when i do, a sub vi window pops up so the operator can set a couple of parameters and press an ok button.....the vi then sends the command with the parameters to the drill's motors.
    i am trying to change it so i can send the move command from another computer, in another room, while the main vi sits on the computer with the drill. i know i will use TCP listen, write, read, and close in both the main vi (the TCP server?) and the client which is on the remote computer.
    my problem is with setting the parameters for the subvi's that usually pops up. how do i set the parameters from the remote-client and have them be sent into the subvi on the main vi. if i can do this, i would have to also have a way to close the sub vi after it pops up in the main program too.
    OR should i use something else like and application reference or an invoke node function?????
    please help
    thanks!!!!
    sam

    Hi again,
    If the VI in the lab will be running continuously, then you will need
    to alter some things from the example I sent you or look at an
    alternate implementation. The example I sent you assumed that the VI in
    the lab was not running. This technique actually starts the VI and runs
    it somewhat like a subVI. It inputs values into the connector pane,
    runs it, and then returns values from the outputs on the connector pane
    after it finishes executing. It will not work to call a VI by reference
    if it is already continuously running.
    Instead I imagine you would want to have your VI in the lab have some
    sort of State Machine that polls a certain control value, such as an
    enum control, to determine which state to execute next. You could
    modify the technique I first sent to still open a reference to the VI
    in the lab, but it wouldn't try to run it. Instead you could use the VI
    method Set Control Value to set the value of a certain control or
    controls in the lab VI to certain values. The VI in the lab would then
    hopefully be in some Idle state where it polled one of those control
    values continuously to decide what to do next. That would allow the VI
    in the office to programmatically send commands to the other VI, as
    well as parameters for those commands. Simply set control values for
    the VI in the lab and let the VI in the lab go about its business. I've
    attached an example below.
    That's just one idea. Other options you have would be to use a
    DataSocket connection to send parameters and commands back and forth
    between computers. This is a pretty simple API to use. If you have
    LabVIEW 8, Shared Variables are an option. Or you might look into
    simply using Remote Front panels, which allows you to connect to a VIs
    Front Panel across the network. You could then have the whole VI in the
    Lab, but you could connect to it, view it, modify the controls and so
    on from your office. If you want to view and control a VI without
    having LabVIEW installed on the viewing computer, you can use the Web
    Publishing Tool to create a web interface for your front panel. Lots of
    options. Let me know what sounds interesting.
    Jarrod S.
    National Instruments
    Attachments:
    Lab_VI.vi ‏29 KB
    Office_VI.vi ‏51 KB

  • Unable to run curl command from process c#

    Below is the curl command i am trying to run from c# script and i failed to execute please help
    curl -K config.cfg
    http://10.10.10.10:8080/MyApp/task
    string curlDirectory = "E:\\application";
    string curlArg1 = " -K ";
    string curlArg2 = "config.cfg";
    string curlArg3 = " http://10.10.10.10:8080/MyApp/task";
    Process process = new Process();
    process.StartInfo.FileName = "cmd.exe";
    process.StartInfo.UseShellExecute = false;
    process.StartInfo.CreateNoWindow = true;
    process.StartInfo.RedirectStandardInput = true;
    process.StartInfo.RedirectStandardError = true;
    process.Start();
    StreamWriter sw = process.StandardInput;
    sw.WriteLine("cd " + curlDirectory);
    sw.WriteLine("curl " + curlArg1 + curlArg2 + curlArg3);
    sw.WriteLine("exit");
    sw.Close();
    C:>cd E:\application\
    E:\application>curl -K config.cfg
    http://10.10.10.10:8080/MyApp/task
    E:\application>exit

    Did you get any error? can you remove the below line and try:
    process.StartInfo.CreateNoWindow = true;
    Fouad Roumieh

  • Is there now a system call to send pass-through commands to ATA devices?

    I want to send pass-through ATA commands to SATA/ATA devices on intel-based solaris. From the beginning the USCSICMD ioctl has worked just fine on SCSI/SAS/FC targets on intel & sparc-based solaris, but the mechanism to send pass-through commands to ATA devices has always been undocumented, closed, unavailable, whatever.
    Is there now a way to do this w/o writing a custom device driver? Does anybody have an example chunk of code that does something simple like send the ATA IDENTIFY command to a disk drive? I know I can use SATL to encapsulate commands to SATA disks using certain SAS controllers, but I really need a way that will work with devices that are plugged into a standard SATA port on a motherboard.
    Thanks

    Hi Dhalek,
    Just tried out a small example and it works ok in SQL Dev 4
    drop table t1;
    create table t1 (col1 int);
    insert into t1 values (1);
    insert into t1 values (2);
    insert into t1 values (3);
    select * from t1;
    /*sqldev:stmt*/BEGIN;
    DELETE FROM t1;
    SELECT * FROM t1;
    /*sqldev:stmt*/ROLLBACK;
    SELECT * FROM t1;
    ---- RESULT ----
    table T1 dropped.
    table T1 created.
    1 rows inserted.
    1 rows inserted.
    1 rows inserted.
    col1      
    1         
    2         
    3         
    /*sqldev:stmt*/BEGIN
    3 rows deleted.
    col1      
    /*sqldev:stmt*/ROLLBACK
    col1      
    1         
    2         
    3        
    Regards,
    Dermot
    SQL Developer Team

  • Send a Unix command through ARD that will change a OS X admin user to a standard user.

    I would love to send a Unix command through ARD that will change a OS X admin user to a standard user. The only thing I found close is
    sudo dscl . -delete /Groups/admin GroupMembership USERNAME
    which does remove the user from the list of admins, but they are still listed as an admin in the user preference panel, and can still use their account to authenticate for admin privileges.

    I'm not having any problems adding or removing users from the 'admin' group by using the syntax's
    dscl . -delete /Groups/admin GroupMembership ARDusername
    or
    dscl . -append /Groups/admin GroupMembership ARDusername
    What I'm saying is if a user is ticked as an Adminstrator in System Preferences and I run the
    dscl . -delete /Groups/admin GroupMembership ARDusername syntax and remove them from the 'admin' GroupMembership they still have the Administrator box ticked in System Prefs and can administer the machine.
    By the way the '/' doesn't work in the syntax in ARD.
    Thanks

  • Curl command to parse web sites

    Hi there,
    I am trying to parse price details on the www.travelbag.co.uk web site. Basically I use a preformatted URL which contains date ranges and hotel information and put that into the Curl command. The idea then is via Applescript to add 1 to the day and have that running in a loop so I can determine which times of the year are the cheapest for a particular hotel etc. I have a working set up for the KenwoodTravel.co.uk web site but the problem with travelbag is that it first returns a holding page (like a please wait whilst we get the details). The Curl returns this http response and finishes. Doing it via a web browser works of course but I was wondering if anyone knew any tricks with the Curl command to wait for the full response?
    Thanks,
    Mike...
    PS hope this all makes sense.

    It is probably working through AJAX, much like the forums here. Your best bet is to debug the site in Safari's developer mode to try to find the AJAX request. You can then feed that into Curl.

  • When I try to open my adobe acrobat X Pro it says it failed to send a DDE command.  It was working perfectly until  yesterday.

    When I try to open my Adobe Acrobat X Pro I get a message that it failed to send a DDE command.  It was working fine until yesterday.

    When I try to open my Adobe Acrobat X Pro I get a message that it failed to send a DDE command.  It was working fine until yesterday.

  • Help sending multiline interface commands

    Hello,
    I have an instrument that is controlled by its own software on a PC that it is connected to with GPIB and RS232. I would like to write a labview program that emulates what the software does. I ran the GPIB analyzer during the initialization of the machine and captured this:
    I want to send these 6 commands in LabView so I have a little vi that initializes the machine. I looked at this thread and tried to follow the advice given there. I need to send the string @?#yI followed by a line feed. I'm very new to LabView so I downloaded the example GPIB read/write and tried to make the changes suggested. Here is a screenshot of my attempt:
    I'm sure this has many mistakes, can someone point them out to me? When I run it it either a) does nothing or b) gives me an error saying "the interface associated with this session is not the controller in charge".
    Also, how can I send the "line feed" character? The manual for the instrument (attached, check page 63) says statements must be followed by a PRINT statement which is the line feed character according to the GPIB analyzer output ("a" in the sixth line).
    Thanks!!!
     

    Thanks for the advice Dennis. This is what I ended up with:
    The VISA read sends the 4 green commands (TA0, UNL, LA3, SC25) by itself and the "I\n" in the buffer sends the data.
    Now I am trying to get information back from the instrument. This screenshot is what the software is doing (and I want to replicate). In the red square are the commands I want VISA read to send. The instrument sends "60." back. 
    Basically, I want to have listener address 0 (LA0), talker address 3 (TA3) and secondary address 13. 
    Here's what I tried:
    You can ignore the stuff at the begining and see that for the VISA read I set the VISA resource name as GPIB::0::13::INSTR. However that created this result:
    There is a big mess of green commands. I need LA0 and TA3. In this case I got LA0 but TA0 instead of TA3. This was the error I got when I ran it:
    So then I tried using the same block diagram but with the address GPIB::0::13::INSTR for the VISA resource name input on the VISA read. This time this is what happened:
    This time I got LA3 not LA0 and the TA was not set at all. This was the error when I ran it:
    Do you have any ideas on how to get this to work properly and what I am doing wrong? 
    Thanks!
     

Maybe you are looking for

  • X509 message level authentication - Unable to validate identity assertions

    Hi All, I am creating a proxy service that will authenticate a soap request with incoming x509 certificate. I configured weblogic server following the below blog post http://tim.blackamber.org.uk/?p=831 I also setup SSL and keystore tab in the weblog

  • Oracle 8i install on Win ME - invalid staging area?

    I'm having trouble installing 8i Personal Edition on Win ME (Athlon 1.3, 768 ram, plenty of disk space). I get the error "Invalid staging area. There are no top level components for Windows 95 available for install from this staging area." on the "Fi

  • Using struts - jsp design question

    Using struts. Have a JSP cust.jsp In it half of it is very specific to that page only. rest half is shown in this cust.jsp and another report.jsp too. want to implement this so that code can be re-used in the other one too. The way I have designed is

  • Can't import .json file

    I'm trying import a json file into my EA project (I'm on version 2014.1.1) by creating a json file with a .json extension, then clicking on the + sign next to Scripts. However, the .json file does not appear in the list. It only appears if I change t

  • Command line in smartform

    In smart form text editor i have to include a command line which exceed the one line . I have tried with page left/right but it is commenting the extra text in new line.