Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

RESTMessageV2 - setQueryParameter, size limit

PhoenixMing0912
Giga Expert

Hi experts,

I have coded a very simple RESTful post and run it in Scripts-Background.

var request = new sn_ws.RESTMessageV2('RemoteServer','Post');

request.setQueryParameter("strBase64", strBase64);

I am trying to send String "strBase64" which is Base64 encoding of an attachment.

However, looks like it has a size limitation, only a couple of KB is allowed to send.

I am quite sure that it is a service now side problem because I have also tried a Java client call and it worked.

Can anyone help?

 

1 ACCEPTED SOLUTION

PhoenixMing0912
Giga Expert

This issue has been solved.

Looks like Service Now has a length limitation setting on "request.setQueryParameter()", while Java doesn't.

I used setRequestBody and large content can be sent out.

View solution in original post

8 REPLIES 8

Hi, thanks for the updating.

Firtst, setRequestBodyFromAttachment() may not work for my case, because I want to send a multi/part request like: Content-Type: multipart/form-data; boundary=_Part_12_16505077.1545180476892.

 

Second, about the request size topic, I have also tried "glide.rest.scripted.max_inbound_content_length_mb" and set it to 10, but it didn't solve my problem. Actually, my attached picture is just 160K, but it's still too big for the request. I am afraid that "setQueryParameter" methods has some limits.

For some reaons, I cannot see what I posted.

PhoenixMing0912
Giga Expert

This issue has been solved.

Looks like Service Now has a length limitation setting on "request.setQueryParameter()", while Java doesn't.

I used setRequestBody and large content can be sent out.

glad you solved it.

you can mark your answer correct and close this thread.