http library for solaris 2.5

Posted on 2001-07-03
Medium Priority
Last Modified: 2013-12-27
I am looking for a class library which would eliminate the need to write HTTP at the socket level.

It should be clean enough so that I could do something simple like this example where I establish a connection to a HTTP server, do a HTTP-POST and disconnect.

ClassHTTPStream httpStream;
ClassHTTP httpObj;

  httpStream = "val=hello world";
  httpObj.connect("", Port);
catch(ClassException E)
  // handle http error here
Question by:PinTail

Expert Comment

ID: 6251240
Does it have to be in C++?  If not, Perl has lots of libaries for doing things like this.

Author Comment

ID: 6251751
C++ is a requirement.

This is a server side application communicating with another server side app via an HTTP server.

It sounds kind of dumb to me, but that's what I have been told to do.

I wrote a HTTP Server about 5 years ago, but since then have had NOTHING to do with HTTP, and really don't want to be bothered to write my own library to do this kind of grunt work, I really just want to ship this data via HTTP in the simplest possible way.

Accepted Solution

graf27 earned 900 total points
ID: 6334362
And you can't use Java for the Post-Request ?

import java.net.*;
import java.io.*;

public class MyClass  {

public static void main(String args[]) throws Exception

  URL target = new URL("http://servername.com/cgi-bin/serverprogram");
  HttpURLConnection conn =    (HttpURLConnection)target.openConnection();


     PrintWriter xout = new PrintWriter(conn.getOutputStream());
       xout.println("what you want to post");

     InputStream xin = conn.getInputStream();
    -- Do anything with the response


On Solaris, you don't need C++ compiler. Just use:

javac  MyClass.java
java MyClass


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question