Web Connection
insufficient stack space
Gravatar is a globally recognized avatar based on your email address. insufficient stack space
  Vincent H.
  All
  Jan 24, 2019 @ 09:32am

Hi Rick,

   loHTTP = CREATEOBJECT ('wwHTTP')
   WITH loHTTP
      .nConnectTimeOut = 30
      .cHttpVerb = "POST"
      .cContentType = "application/json"
      .addheader("Authorization", "Bearer " + Mcle)
      *.addheader("Content-Type", "application/json")
      TEXT TO lcJSON TEXTMERGE NOSHOW PRETEXT 15
      {
        "name": "<<JUSTFNAME(Mfichier)>>",
        "content": "<<STRCONV(FILETOSTR(Mfichier),13)>>",
      }
      ENDTEXT
      .AddPostKey(lcJSON)

Mfichier is 187 KB
And I have the error message in the subject. Something wrong ?

Thanks in advance,

Vincent

Gravatar is a globally recognized avatar based on your email address. re: insufficient stack space
  Vincent H.
  Vincent H.
  Jan 24, 2019 @ 09:41am

I must write .AddPostKey("", lcJSON)

Sorry for this useless message ...

Gravatar is a globally recognized avatar based on your email address. re: insufficient stack space
  Rick Strahl
  Vincent H.
  Jan 24, 2019 @ 01:41pm

Hmmm... you shouldn't need to write:

loHttp.AddPostKey("",lcJson)

This should work just the same - as long you set the content type (which you have).

loHttp.cContentType = "application/json"
loHttp.AddPostKey(lcJson)

wwHttp checks if the parm count < 2 and in that case automatically sets the key to "" so effectively that code is exactly the same.

Just to be sure I tried your code and as you posted it and it works just fine.

I suspect the memory issue comes from the textmerge perhaps or some other unrelated memory pressure in your application.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: insufficient stack space
  Vincent H.
  Rick Strahl
  Jan 25, 2019 @ 01:24pm

Thank you Rick !

© 1996-2019