HTTPRequest(ext) variant call with content-type and headers

I am having troubles compiling the extended version of HTTPRequest. There are two versions in the C10 documentation. The second version has two extra fields passed into the procedure: content-type and headers.

I can compile the first version of HTTPRequest but not the extended version. The commented code below compiles but the second line of code does not. Any ideas?

I have all of the variables declared in the procedure or globally, it does not matter. The compiler is coming back with a “No matching prototype available” error. I have looked in ClaRunExt.clw and .inc and the extended version is prototyped in there. And, it appears that I do not need to set any conditional compilation symbols in the project either. I have used the CLATalk class in my project

If I cannot use the second version then I may need some help figuring out where to put the header data in since the Clarion documentation is very vague. I do not want to use NetTalk at this point. I would prefer to use the resident Clarion calls instead.

!STATUS = CLATLK.HTTPWEBREQUEST(HTTPWEBADDRESS, HttpVerb:POST, POSTDATA, REQUESTPARAMETERS, RESPONSEOUT)  ! Compiles

STATUS = CLATLK.HTTPWEBREQUEST(HTTPWEBADDRESS, HttpVerb:POST, POSTDATA, REQUESTPARAMETERS, CONTENTYPE, HEADERS, RESPONSEOUT) ! Does not compile

Thanks all and Merry Christmas!

What are the definitions of ContentType and Headers?

Here is the procedure prototype in CLARunEXT.INC:

HttpWebRequest PROCEDURE(CONST *CSTRING httpWebAddress,LONG httpVerbMethod,CONST *CSTRING postData,CONST *CSTRING requestParameters,CONST *CSTRING contentType, CONST *CSTRING headers,*CSTRING responseOut),LONG

The only difference between this prototype and the first one is the missing “ContentType” and “Headers” variables. Simple CStrings…

Thanks for replying Rick!

I meant what are the definitions of your variables ContentType and Headers?

Here is what I have declared:

HTTPWEBADDRESS CSTRING(256)
POSTDATA CSTRING(1024)
REQUESTPARAMETERS CSTRING(256)
CONTENTTYPE CSTRING(256)
HEADERS CSTRING(1024)
RESPONSEOUT CSTRING(64000)

STATUS LONG

Your variable is CONTENTTYPE but you are passing CONTENTYPE :slight_smile:

1 Like

Frack!

You 'da Man Rick, You 'da Man! Thanks again and Merry Christmas!

1 Like

Thanks, Have a Merry Christmas, too.