Multipart POST in OB2

Every question about multipart post in the forum is referring to an OB2 version where a “string content” button was present. In the present version it seems the only way now in OB2 to edit multipart is through lolicode, so can anyone give me an example on how to write in lolicode this multipart post:

------WebKitFormBoundarytqy3hhAjOJyk3BDR
Content-Disposition: form-data; name="username"

asdasdsda
------WebKitFormBoundarytqy3hhAjOJyk3BDR
Content-Disposition: form-data; name="password"

dasdasdasdasd
------WebKitFormBoundarytqy3hhAjOJyk3BDR
Content-Disposition: form-data; name="rv"

true
------WebKitFormBoundarytqy3hhAjOJyk3BDR--

I know there used to be a STRING: parameter but how do I fit it here:

BLOCK:HttpRequest
  url = "https://www.someurl.com"
  method = POST
  TYPE:MULTIPART
  
ENDBLOCK

Thanks

1 Like

Hey, the web version has UI support for this. I haven’t had time to add it to the native version yet. Anyways this is the syntax you can use for the 3 types of fields that are available

BLOCK:HttpRequest
  TYPE:MULTIPART
  ""
  CONTENT:STRING "name" "data" "text/plain"
  CONTENT:RAW "name" q6ur "application/octet-stream"
  CONTENT:FILE "name" "myfile.txt" "application/octet-stream"
ENDBLOCK

In your case you need 3 string contents

Right now Multipart is editable only through LoliCode, but I have a trick where it always works.
Use the Multipart Data as Standard Data instead.
Like yours would be: username=<input.USER>&password=<input.PASS>&rv=true
Try it and tell me.

2 Likes

:+1: Well done !!
Thanx for the trick !

please hep me, thank you

Screenshot 2022-04-04 202550

You have to write @input.USERNAME instead of "input.USERNAME" (remove the double quotes). Same for the password. This is how to use variables in Lolicode. The other way would be to do $"<input.USERNAME>" but it’s not necessary here since it’s just 1 variable and not an interpolation of multiple things.

1 Like