« Back to full topics list
Marked as spam
Posted by - Asked on December 17, 2016 10:31 pm - 75 views

1 Replies

Private reply

Hello Wendy,

There are two things that you need to fix in your code:

1) Scriptr.io automatically calculates the content-length of your content, so you should not pass the content-length header field yourself.
2) There is a mistake in your code. You are sending “rawBody” instead of “bodyString” as in the below:

var test = "foo bar";

return http.request({
	url : "http://mysterious-sierra-8455.herokuapp.com/abcd",
	method : 'PUT',
	headers : {
		"Content-Type" : 'application/json',
	"bodyString" : test

Please note that “rawBody” is for the “request” object not for “http”. Replace rawBody with bodyString and your code should work fine.


Julien Mrad

Marked as spam
Posted by - Replied on December 18, 2016 9:34 am