[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

HTTPAPI - http_post_stmf - HTTP/1.1 415 Unsupported Media Type


   I encounter a problem using httpapi.

   I try to call a web service provided by TNT (to get Label data) and I
   get the following error  :

   HTTP/1.1 415 Unsupported Media Type

   What I can say

   -          It's not an authorization problem because The https_init and
   http_setauth get a 0 return and this point is confirmed by TNT

   -          I tried the XML request (in the file extnt.xml) with soapui,
   which functions successful

   -          I tried with content type to blank as proposed in  the
   following thread  but got the error "HTTP/1.1 400 Bad Request"


   Today I am blocked an don't know what I can do to go ahead.

   Thank you in advance for your help


   The Code used :


           tmp_user = `...';

           tmp_passwd = '...';

           tmp_url = 'https://express.tnt.com/expresslabel/'

                         + 'documentation/getlabel';

           tmp_rc = https_init('KUHN_HTTPAPI');

           tmp_rc = http_setauth(http_auth_basic:tmp_user:tmp_passwd) ;

           if tmp_rc =  0 ;

              tmp_rc = http_post_stmf( tmp_URL: '/Data/xml/extnt.xml'

                          : '/Data/xml/ret.txt'

                          : 30

                          : *omit

          //              : '' );

                          : 'text/xml;charset=UTF-8' );

              if tmp_rc <> 1 ;

                 tmp_str500= http_error();

                 dsply 'POSx' ;

                 tmp_str50 = %SUBST(tmp_str500:1:50)        ;

                 DSPLY tmp_str50                      ;

                 tmp_str50 = %SUBST(tmp_str500:51:100)        ;

                 DSPLY tmp_str50                      ;



   This email is intended only for use by the addresse(s) named in the
   message, and may contain confidential information. If you are not the
   intended recipient of this email message, any distribution or copying
   of this email is strictly prohibited. If you have received this email
   in error, please notify the sender immediately. The integrity and
   security of this message can not be guaranteed on the Internet.
   Although KUHN operates anti-virus programs, it does not accept
   responsibility for any damage whatsoever that is caused by viruses
   being passed.


   1. http://www.scottklement.com/archives/ftpapi/200904/msg00078.html
This is the FTPAPI mailing list.  To unsubscribe, please go to: