[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: HTTPAPI - http_post_stmf - HTTP/1.1 415 Unsupported Media Type
Please have HTTPAPI generate a debug/trace file and post it here.
On 12/16/2013 3:13 AM, Frédéric UHRY wrote:
Hello,
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"
[1][1]http://www.scottklement.com/archives/ftpapi/200904/msg00078.html
Today I am blocked an don't know what I can do to go ahead.
Thank you in advance for your help
Frederic
The Code used :
/free
tmp_user = `...';
tmp_passwd = '...';
tmp_url = '[2]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 ;
endif;
__________________________________________________________________
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.
References
1. [3]http://www.scottklement.com/archives/ftpapi/200904/msg00078.html
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
[4]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
References
1. http://www.scottklement.com/archives/ftpapi/200904/msg00078.html
2. https://express.tnt.com/expresslabel/
3. http://www.scottklement.com/archives/ftpapi/200904/msg00078.html
4. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------