MHFRunL() fails with -7361

Login to reply to this topic.
Thu, 2006-04-20 17:13
Joined: 2005-07-22
Forum posts: 52
Hi ,

I am calling a URL with an HTTP connection . However , the MHFRunL fails with status code -7361 . In httperr.h it refers to KHTTPErrorBase . The URL I pass is of the form : http://www.hostname.com/somefile.txt

How do I fix this error ?

Thanks a lot Smiley

Thu, 2007-08-23 04:58
Joined: 2007-08-23
Forum posts: 1
Re: MHFRunL() fails with -7361

Hi,

I struggled with MHFRunL failing with status code -7360. It turned out that I hadn't set the "Content-Type" in the HTTP header. Adding the following line solved the problem:

SetHeaderL(hdr, HTTP::EContentType, KContentMimeType);

The above post's reference to httperr.h lead me to the solution. In httperr.h -7360 is defined as:
const TInt KErrHttpEntityHeaderMissingContentType = KErrHttpMissingHeaderBase

where:
const TInt KHttpErrorBase = -7200;
const TInt KErrHttpMissingHeaderBase = KHttpErrorBase - 160

Hope this saves time for someone in the future.

BTW -7361 is defined as:

const TInt KErrHttpGeneralHeaderMissingHost = KErrHttpMissingHeaderBase - 1;

Thu, 2007-08-23 10:01
Joined: 2007-06-21
Forum posts: 82
Re: MHFRunL() fails with -7361

Hi
Go to this link:
http://www.newlc.com/Symbian-OS-Error-Codes.html

You will find all error codes...

In your case:
KErrHttpGeneralHeaderMissingHost -7361 The request URI was relative, but no Host header was set to indicate a server to connect to

You have not set the host header....

In you IssueHTTPGetL and IssueHTTPPostL, have this line:
SetHeaderL(hdr, HTTP::EHost,uri.Extract(EUriHost));

alongwith other SetHeader calls you are making...It will solve the problem...

Br
Gurpreet
www.mobisy.com

  • Login to reply to this topic.