ContentType('multipart/form-data; boundary=' + oMultiEntity:Boundary) HTTPRequest - Forum - OpenEdge Development - Progress Community

ContentType('multipart/form-data; boundary=' + oMultiEntity:Boundary) HTTPRequest

 Forum

ContentType('multipart/form-data; boundary=' + oMultiEntity:Boundary) HTTPRequest

This question is answered

Hi everyone, 

I'm having the following error doing an HTTP Request:

Lead attributes in a chained-attribute expression (a:b:c) must be type HANDLE or a user-defined type and valid (not UNKNOWN). (10068) 

This error only occurs with OE 11.7.3  when I set "ContentType" to multipart/form-data" as I show below:

Request = RequestBuilder:POST(oURI, oMultiEntity):AcceptAll():ContentType('multipart/form-data; boundary=' + MultiEntity:Boundary):Request.

This same code works perfect using OE11.7.2.

Also I found this article https://knowledgebase.progress.com/articles/Article/Error-10068-with-HTTP-client-multipart-form-data-content-type-in-11-7-3.

I'm not able to downgrade to 11.7.2 because I need some of new features of this version but also need this code working. 

Anybody have an a idea?

Thank you in advance.

Verified Answer
  • This is caused by the introduction of a new multipart/form-data writer in 11.7.3; that class does not accept MultipartEntity objects. In 11.7.4 it is fixed.

    To workaround this you can revert back to the previous behaviour by removing the writer from the relevant registry. It only needs to be done once in a session, although it doesn't hurt to do it before each call.  Once you ahve a fix, remove this line.

    OpenEdge.Net.HTTP.Filter.Writer.BodyWriterRegistry:Registry:Remove('multipart/form-data':u).



All Replies
  • Are you seeing the error on building the request, or on processing the response?

    There is an issue on processing multpart responses, that has to do with how the boundary parameter on the Content-Type header is processed (it happens if the Content-Type's boundary parameter value is quoted).  This issue is OCTA-6949 if you contact tech support.

  • Hi Peter, this problem happen when I'm building the request.

    Set contentType as multipart/form-data is mandatory because is required by the API,

    I'm in contact with tech support but we don't know how to fix it yet.

    Multipart responses are working fine using FixBoundaryWriter.cls that you shared a few weeks ago.

  • This is caused by the introduction of a new multipart/form-data writer in 11.7.3; that class does not accept MultipartEntity objects. In 11.7.4 it is fixed.

    To workaround this you can revert back to the previous behaviour by removing the writer from the relevant registry. It only needs to be done once in a session, although it doesn't hurt to do it before each call.  Once you ahve a fix, remove this line.

    OpenEdge.Net.HTTP.Filter.Writer.BodyWriterRegistry:Registry:Remove('multipart/form-data':u).



  • Thanks a lot, this fixed my problem.