Re: [Dev] Reading headers/form fields of a multipart/form-data request in msf4j

2016-05-26 Thread Thusitha Thilina Dayaratne
Hi All,

I started looking into implementing FormParam support for MSF4J. AFAIU we
need to support below content types

   1. application/x-www-form-urlencoded
   2. multpart/form-data

For the *application/x-www-form-urlencoded *
This is pretty much similar to the QueryParam. We can read the Request body
and get the encoded string and process that as a key-value pair.

For the *multpart/form-data*
We can implement the multpart/form-data support to cater requests like file
upload.
Rather than decoding multipart content by ourselves we can use a
multipart/form-data parsing library to parse the raw HTTP body. Following
apache libraries can be used for this purpose

   1. Apache Clerezza [1]
   2. Apache Commons-Fileupload [2]

As discussed in early in the thread we can't use Commons-Fileupload out of
the box to cater our requirements. But we can get the code and modify the
to tally with our implementation and work on the FormParam implementation.

[1] - https://clerezza.apache.org/
[2] - https://commons.apache.org/proper/commons-fileupload/

Thanks

On Wed, May 11, 2016 at 11:31 AM, Samiyuru Senarathne 
wrote:

> When I was looking into form processing in MSF4J, I was looking at
> modifying apache commons [1][2] to meet our needs since it has multipart
> support and it is widely used with servlets. But IMO we wont be able to use
> it directly out of the box as a library to parse the byte buffer we have
> because it starts processing from a servlet request object.
>
> [1] - https://commons.apache.org/proper/commons-fileupload/using.html
> [2] - https://commons.apache.org/proper/commons-fileupload/streaming.html
>
> On Wed, May 11, 2016 at 11:18 AM, Himasha Guruge 
> wrote:
>
>> In C4 we have used [1] for this purpose.
>>
>> [1] http://cxf.apache.org/docs/jax-rs-multiparts.html
>>
>> On Wed, May 11, 2016 at 11:12 AM, Afkham Azeez  wrote:
>>
>>> Any libraries you are familiar with? Since BPS folks are using the code
>>> from the MSF4J master branch, we may be able to quickly implement it.
>>>
>>> On Wed, May 11, 2016 at 11:09 AM, Samiyuru Senarathne >> > wrote:
>>>
 Hi Azeez,

 Yes I looked at this sometime back. But it was not progressed to the
 implementation level.

 For the moment we will have to use a multipart/form-data parsing
 library to parse the raw HTTP body. We can get the raw HTTP body by
 injecting an org.wso2.msf4j.Request object to the resource method using
 @Context annotation.

 Best Regards,
 Samiyuru

 On Wed, May 11, 2016 at 11:02 AM, Afkham Azeez  wrote:

> Samiyuru,
> You looked at this some time back right? What work is involved in
> implementing this?
>
> Azeez
>
> On Wed, May 11, 2016 at 11:00 AM, Himasha Guruge 
> wrote:
>
>> From the offline discussion with Azeez, it seems that this is not
>> supported in current msf4j implementation. How are we to proceed with the
>> use case of acquiring form field values from the request?
>>
>>
>>
>> On Wed, Apr 6, 2016 at 11:22 AM, Himasha Guruge 
>> wrote:
>>
>>> Hi All,
>>>
>>> I have gone through the available sample [1]  on how to process a
>>> stream and read and save files in msf4j. However given a request with 
>>> form
>>> fields like [2] , how can we retrieve those form fields in msf4j? If it 
>>> is
>>> to read from the stream itself, any suggested way to do this?
>>>
>>> [1]
>>> https://github.com/wso2/msf4j/blob/652435ee7f8fdf31307667adb888e9a13513f6d8/samples/petstore/microservices/fileserver/src/main/java/org/wso2/msf4j/examples/petstore/fileserver/FileServerService.java
>>>
>>> [2] curl --form
>>> "fileupload=@Desktop/bigdot.png;filename=desired-filename.txt" --form
>>> param1=value1 --form param2=value2
>>> http://localhost:8080/bps/repo/stream
>>>
>>> Thanks,
>>>
>>> Himasha Guruge
>>> *Software Engineer*
>>> WS*O2* *Inc.*
>>> Mobile: +94 777459299
>>> himas...@wso2.com
>>>
>>
>>
>>
>> --
>> Himasha Guruge
>> *Software Engineer*
>> WS*O2* *Inc.*
>> Mobile: +94 777459299
>> himas...@wso2.com
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * *
> *email: **az...@wso2.com* 
> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
> *http://blog.afkham.org* 
> *twitter: **http://twitter.com/afkham_azeez*
> 
> *linked-in: 

Re: [Dev] Reading headers/form fields of a multipart/form-data request in msf4j

2016-05-11 Thread Samiyuru Senarathne
When I was looking into form processing in MSF4J, I was looking at
modifying apache commons [1][2] to meet our needs since it has multipart
support and it is widely used with servlets. But IMO we wont be able to use
it directly out of the box as a library to parse the byte buffer we have
because it starts processing from a servlet request object.

[1] - https://commons.apache.org/proper/commons-fileupload/using.html
[2] - https://commons.apache.org/proper/commons-fileupload/streaming.html

On Wed, May 11, 2016 at 11:18 AM, Himasha Guruge  wrote:

> In C4 we have used [1] for this purpose.
>
> [1] http://cxf.apache.org/docs/jax-rs-multiparts.html
>
> On Wed, May 11, 2016 at 11:12 AM, Afkham Azeez  wrote:
>
>> Any libraries you are familiar with? Since BPS folks are using the code
>> from the MSF4J master branch, we may be able to quickly implement it.
>>
>> On Wed, May 11, 2016 at 11:09 AM, Samiyuru Senarathne 
>> wrote:
>>
>>> Hi Azeez,
>>>
>>> Yes I looked at this sometime back. But it was not progressed to the
>>> implementation level.
>>>
>>> For the moment we will have to use a multipart/form-data parsing library
>>> to parse the raw HTTP body. We can get the raw HTTP body by injecting an
>>> org.wso2.msf4j.Request object to the resource method using @Context
>>> annotation.
>>>
>>> Best Regards,
>>> Samiyuru
>>>
>>> On Wed, May 11, 2016 at 11:02 AM, Afkham Azeez  wrote:
>>>
 Samiyuru,
 You looked at this some time back right? What work is involved in
 implementing this?

 Azeez

 On Wed, May 11, 2016 at 11:00 AM, Himasha Guruge 
 wrote:

> From the offline discussion with Azeez, it seems that this is not
> supported in current msf4j implementation. How are we to proceed with the
> use case of acquiring form field values from the request?
>
>
>
> On Wed, Apr 6, 2016 at 11:22 AM, Himasha Guruge 
> wrote:
>
>> Hi All,
>>
>> I have gone through the available sample [1]  on how to process a
>> stream and read and save files in msf4j. However given a request with 
>> form
>> fields like [2] , how can we retrieve those form fields in msf4j? If it 
>> is
>> to read from the stream itself, any suggested way to do this?
>>
>> [1]
>> https://github.com/wso2/msf4j/blob/652435ee7f8fdf31307667adb888e9a13513f6d8/samples/petstore/microservices/fileserver/src/main/java/org/wso2/msf4j/examples/petstore/fileserver/FileServerService.java
>>
>> [2] curl --form
>> "fileupload=@Desktop/bigdot.png;filename=desired-filename.txt" --form
>> param1=value1 --form param2=value2
>> http://localhost:8080/bps/repo/stream
>>
>> Thanks,
>>
>> Himasha Guruge
>> *Software Engineer*
>> WS*O2* *Inc.*
>> Mobile: +94 777459299
>> himas...@wso2.com
>>
>
>
>
> --
> Himasha Guruge
> *Software Engineer*
> WS*O2* *Inc.*
> Mobile: +94 777459299
> himas...@wso2.com
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


 --
 *Afkham Azeez*
 Director of Architecture; WSO2, Inc.; http://wso2.com
 Member; Apache Software Foundation; http://www.apache.org/
 * *
 *email: **az...@wso2.com* 
 * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
 *http://blog.afkham.org* 
 *twitter: **http://twitter.com/afkham_azeez*
 
 *linked-in: **http://lk.linkedin.com/in/afkhamazeez
 *

 *Lean . Enterprise . Middleware*

>>>
>>>
>>>
>>> --
>>> Samiyuru Senarathne
>>> *Software Engineer*
>>> Mobile : +94 (0) 71 134 6087
>>> samiy...@wso2.com
>>>
>>
>>
>>
>> --
>> *Afkham Azeez*
>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> Member; Apache Software Foundation; http://www.apache.org/
>> * *
>> *email: **az...@wso2.com* 
>> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
>> *http://blog.afkham.org* 
>> *twitter: **http://twitter.com/afkham_azeez*
>> 
>> *linked-in: **http://lk.linkedin.com/in/afkhamazeez
>> *
>>
>> *Lean . Enterprise . Middleware*
>>
>
>
>
> --
> Himasha Guruge
> *Software Engineer*
> WS*O2* *Inc.*
> Mobile: +94 777459299
> himas...@wso2.com
>



-- 
Samiyuru Senarathne
*Software Engineer*
Mobile : +94 (0) 71 134 6087
samiy...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Reading headers/form fields of a multipart/form-data request in msf4j

2016-05-10 Thread Himasha Guruge
In C4 we have used [1] for this purpose.

[1] http://cxf.apache.org/docs/jax-rs-multiparts.html

On Wed, May 11, 2016 at 11:12 AM, Afkham Azeez  wrote:

> Any libraries you are familiar with? Since BPS folks are using the code
> from the MSF4J master branch, we may be able to quickly implement it.
>
> On Wed, May 11, 2016 at 11:09 AM, Samiyuru Senarathne 
> wrote:
>
>> Hi Azeez,
>>
>> Yes I looked at this sometime back. But it was not progressed to the
>> implementation level.
>>
>> For the moment we will have to use a multipart/form-data parsing library
>> to parse the raw HTTP body. We can get the raw HTTP body by injecting an
>> org.wso2.msf4j.Request object to the resource method using @Context
>> annotation.
>>
>> Best Regards,
>> Samiyuru
>>
>> On Wed, May 11, 2016 at 11:02 AM, Afkham Azeez  wrote:
>>
>>> Samiyuru,
>>> You looked at this some time back right? What work is involved in
>>> implementing this?
>>>
>>> Azeez
>>>
>>> On Wed, May 11, 2016 at 11:00 AM, Himasha Guruge 
>>> wrote:
>>>
 From the offline discussion with Azeez, it seems that this is not
 supported in current msf4j implementation. How are we to proceed with the
 use case of acquiring form field values from the request?



 On Wed, Apr 6, 2016 at 11:22 AM, Himasha Guruge 
 wrote:

> Hi All,
>
> I have gone through the available sample [1]  on how to process a
> stream and read and save files in msf4j. However given a request with form
> fields like [2] , how can we retrieve those form fields in msf4j? If it is
> to read from the stream itself, any suggested way to do this?
>
> [1]
> https://github.com/wso2/msf4j/blob/652435ee7f8fdf31307667adb888e9a13513f6d8/samples/petstore/microservices/fileserver/src/main/java/org/wso2/msf4j/examples/petstore/fileserver/FileServerService.java
>
> [2] curl --form
> "fileupload=@Desktop/bigdot.png;filename=desired-filename.txt" --form
> param1=value1 --form param2=value2
> http://localhost:8080/bps/repo/stream
>
> Thanks,
>
> Himasha Guruge
> *Software Engineer*
> WS*O2* *Inc.*
> Mobile: +94 777459299
> himas...@wso2.com
>



 --
 Himasha Guruge
 *Software Engineer*
 WS*O2* *Inc.*
 Mobile: +94 777459299
 himas...@wso2.com

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>>
>>> --
>>> *Afkham Azeez*
>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>> Member; Apache Software Foundation; http://www.apache.org/
>>> * *
>>> *email: **az...@wso2.com* 
>>> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
>>> *http://blog.afkham.org* 
>>> *twitter: **http://twitter.com/afkham_azeez*
>>> 
>>> *linked-in: **http://lk.linkedin.com/in/afkhamazeez
>>> *
>>>
>>> *Lean . Enterprise . Middleware*
>>>
>>
>>
>>
>> --
>> Samiyuru Senarathne
>> *Software Engineer*
>> Mobile : +94 (0) 71 134 6087
>> samiy...@wso2.com
>>
>
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * *
> *email: **az...@wso2.com* 
> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
> *http://blog.afkham.org* 
> *twitter: **http://twitter.com/afkham_azeez*
> 
> *linked-in: **http://lk.linkedin.com/in/afkhamazeez
> *
>
> *Lean . Enterprise . Middleware*
>



-- 
Himasha Guruge
*Software Engineer*
WS*O2* *Inc.*
Mobile: +94 777459299
himas...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Reading headers/form fields of a multipart/form-data request in msf4j

2016-05-10 Thread Afkham Azeez
Any libraries you are familiar with? Since BPS folks are using the code
from the MSF4J master branch, we may be able to quickly implement it.

On Wed, May 11, 2016 at 11:09 AM, Samiyuru Senarathne 
wrote:

> Hi Azeez,
>
> Yes I looked at this sometime back. But it was not progressed to the
> implementation level.
>
> For the moment we will have to use a multipart/form-data parsing library
> to parse the raw HTTP body. We can get the raw HTTP body by injecting an
> org.wso2.msf4j.Request object to the resource method using @Context
> annotation.
>
> Best Regards,
> Samiyuru
>
> On Wed, May 11, 2016 at 11:02 AM, Afkham Azeez  wrote:
>
>> Samiyuru,
>> You looked at this some time back right? What work is involved in
>> implementing this?
>>
>> Azeez
>>
>> On Wed, May 11, 2016 at 11:00 AM, Himasha Guruge 
>> wrote:
>>
>>> From the offline discussion with Azeez, it seems that this is not
>>> supported in current msf4j implementation. How are we to proceed with the
>>> use case of acquiring form field values from the request?
>>>
>>>
>>>
>>> On Wed, Apr 6, 2016 at 11:22 AM, Himasha Guruge 
>>> wrote:
>>>
 Hi All,

 I have gone through the available sample [1]  on how to process a
 stream and read and save files in msf4j. However given a request with form
 fields like [2] , how can we retrieve those form fields in msf4j? If it is
 to read from the stream itself, any suggested way to do this?

 [1]
 https://github.com/wso2/msf4j/blob/652435ee7f8fdf31307667adb888e9a13513f6d8/samples/petstore/microservices/fileserver/src/main/java/org/wso2/msf4j/examples/petstore/fileserver/FileServerService.java

 [2] curl --form
 "fileupload=@Desktop/bigdot.png;filename=desired-filename.txt" --form
 param1=value1 --form param2=value2
 http://localhost:8080/bps/repo/stream

 Thanks,

 Himasha Guruge
 *Software Engineer*
 WS*O2* *Inc.*
 Mobile: +94 777459299
 himas...@wso2.com

>>>
>>>
>>>
>>> --
>>> Himasha Guruge
>>> *Software Engineer*
>>> WS*O2* *Inc.*
>>> Mobile: +94 777459299
>>> himas...@wso2.com
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Afkham Azeez*
>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> Member; Apache Software Foundation; http://www.apache.org/
>> * *
>> *email: **az...@wso2.com* 
>> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
>> *http://blog.afkham.org* 
>> *twitter: **http://twitter.com/afkham_azeez*
>> 
>> *linked-in: **http://lk.linkedin.com/in/afkhamazeez
>> *
>>
>> *Lean . Enterprise . Middleware*
>>
>
>
>
> --
> Samiyuru Senarathne
> *Software Engineer*
> Mobile : +94 (0) 71 134 6087
> samiy...@wso2.com
>



-- 
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* *
*email: **az...@wso2.com* 
* cell: +94 77 3320919blog: **http://blog.afkham.org*

*twitter: **http://twitter.com/afkham_azeez*

*linked-in: **http://lk.linkedin.com/in/afkhamazeez
*

*Lean . Enterprise . Middleware*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Reading headers/form fields of a multipart/form-data request in msf4j

2016-05-10 Thread Samiyuru Senarathne
Hi Azeez,

Yes I looked at this sometime back. But it was not progressed to the
implementation level.

For the moment we will have to use a multipart/form-data parsing library to
parse the raw HTTP body. We can get the raw HTTP body by injecting an
org.wso2.msf4j.Request object to the resource method using @Context
annotation.

Best Regards,
Samiyuru

On Wed, May 11, 2016 at 11:02 AM, Afkham Azeez  wrote:

> Samiyuru,
> You looked at this some time back right? What work is involved in
> implementing this?
>
> Azeez
>
> On Wed, May 11, 2016 at 11:00 AM, Himasha Guruge 
> wrote:
>
>> From the offline discussion with Azeez, it seems that this is not
>> supported in current msf4j implementation. How are we to proceed with the
>> use case of acquiring form field values from the request?
>>
>>
>>
>> On Wed, Apr 6, 2016 at 11:22 AM, Himasha Guruge 
>> wrote:
>>
>>> Hi All,
>>>
>>> I have gone through the available sample [1]  on how to process a stream
>>> and read and save files in msf4j. However given a request with form fields
>>> like [2] , how can we retrieve those form fields in msf4j? If it is to read
>>> from the stream itself, any suggested way to do this?
>>>
>>> [1]
>>> https://github.com/wso2/msf4j/blob/652435ee7f8fdf31307667adb888e9a13513f6d8/samples/petstore/microservices/fileserver/src/main/java/org/wso2/msf4j/examples/petstore/fileserver/FileServerService.java
>>>
>>> [2] curl --form
>>> "fileupload=@Desktop/bigdot.png;filename=desired-filename.txt" --form
>>> param1=value1 --form param2=value2 http://localhost:8080/bps/repo/stream
>>>
>>> Thanks,
>>>
>>> Himasha Guruge
>>> *Software Engineer*
>>> WS*O2* *Inc.*
>>> Mobile: +94 777459299
>>> himas...@wso2.com
>>>
>>
>>
>>
>> --
>> Himasha Guruge
>> *Software Engineer*
>> WS*O2* *Inc.*
>> Mobile: +94 777459299
>> himas...@wso2.com
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * *
> *email: **az...@wso2.com* 
> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
> *http://blog.afkham.org* 
> *twitter: **http://twitter.com/afkham_azeez*
> 
> *linked-in: **http://lk.linkedin.com/in/afkhamazeez
> *
>
> *Lean . Enterprise . Middleware*
>



-- 
Samiyuru Senarathne
*Software Engineer*
Mobile : +94 (0) 71 134 6087
samiy...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Reading headers/form fields of a multipart/form-data request in msf4j

2016-05-10 Thread Afkham Azeez
Samiyuru,
You looked at this some time back right? What work is involved in
implementing this?

Azeez

On Wed, May 11, 2016 at 11:00 AM, Himasha Guruge  wrote:

> From the offline discussion with Azeez, it seems that this is not
> supported in current msf4j implementation. How are we to proceed with the
> use case of acquiring form field values from the request?
>
>
>
> On Wed, Apr 6, 2016 at 11:22 AM, Himasha Guruge  wrote:
>
>> Hi All,
>>
>> I have gone through the available sample [1]  on how to process a stream
>> and read and save files in msf4j. However given a request with form fields
>> like [2] , how can we retrieve those form fields in msf4j? If it is to read
>> from the stream itself, any suggested way to do this?
>>
>> [1]
>> https://github.com/wso2/msf4j/blob/652435ee7f8fdf31307667adb888e9a13513f6d8/samples/petstore/microservices/fileserver/src/main/java/org/wso2/msf4j/examples/petstore/fileserver/FileServerService.java
>>
>> [2] curl --form
>> "fileupload=@Desktop/bigdot.png;filename=desired-filename.txt" --form
>> param1=value1 --form param2=value2 http://localhost:8080/bps/repo/stream
>>
>> Thanks,
>>
>> Himasha Guruge
>> *Software Engineer*
>> WS*O2* *Inc.*
>> Mobile: +94 777459299
>> himas...@wso2.com
>>
>
>
>
> --
> Himasha Guruge
> *Software Engineer*
> WS*O2* *Inc.*
> Mobile: +94 777459299
> himas...@wso2.com
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* *
*email: **az...@wso2.com* 
* cell: +94 77 3320919blog: **http://blog.afkham.org*

*twitter: **http://twitter.com/afkham_azeez*

*linked-in: **http://lk.linkedin.com/in/afkhamazeez
*

*Lean . Enterprise . Middleware*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Reading headers/form fields of a multipart/form-data request in msf4j

2016-05-10 Thread Himasha Guruge
>From the offline discussion with Azeez, it seems that this is not supported
in current msf4j implementation. How are we to proceed with the use case of
acquiring form field values from the request?



On Wed, Apr 6, 2016 at 11:22 AM, Himasha Guruge  wrote:

> Hi All,
>
> I have gone through the available sample [1]  on how to process a stream
> and read and save files in msf4j. However given a request with form fields
> like [2] , how can we retrieve those form fields in msf4j? If it is to read
> from the stream itself, any suggested way to do this?
>
> [1]
> https://github.com/wso2/msf4j/blob/652435ee7f8fdf31307667adb888e9a13513f6d8/samples/petstore/microservices/fileserver/src/main/java/org/wso2/msf4j/examples/petstore/fileserver/FileServerService.java
>
> [2] curl --form
> "fileupload=@Desktop/bigdot.png;filename=desired-filename.txt" --form
> param1=value1 --form param2=value2 http://localhost:8080/bps/repo/stream
>
> Thanks,
>
> Himasha Guruge
> *Software Engineer*
> WS*O2* *Inc.*
> Mobile: +94 777459299
> himas...@wso2.com
>



-- 
Himasha Guruge
*Software Engineer*
WS*O2* *Inc.*
Mobile: +94 777459299
himas...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Reading headers/form fields of a multipart/form-data request in msf4j

2016-04-05 Thread Himasha Guruge
Hi All,

I have gone through the available sample [1]  on how to process a stream
and read and save files in msf4j. However given a request with form fields
like [2] , how can we retrieve those form fields in msf4j? If it is to read
from the stream itself, any suggested way to do this?

[1]
https://github.com/wso2/msf4j/blob/652435ee7f8fdf31307667adb888e9a13513f6d8/samples/petstore/microservices/fileserver/src/main/java/org/wso2/msf4j/examples/petstore/fileserver/FileServerService.java

[2] curl --form
"fileupload=@Desktop/bigdot.png;filename=desired-filename.txt" --form
param1=value1 --form param2=value2 http://localhost:8080/bps/repo/stream

Thanks,

Himasha Guruge
*Software Engineer*
WS*O2* *Inc.*
Mobile: +94 777459299
himas...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev