Problem in consuming REST Service

Hi,

Am trying to consume a rest service. Below is the screenshot and the details.

EndPoint : “http://api.mathjs.org/v4/
Request : “”{““expr””: [““a = 1.2 * (2 + 4.5)””,““a / 2"”,”“5.08 cm in inch”“,”“sin(45 deg) ^ 2"”,““9 / 3 + 2i””,““b = [-1, 2; 3, 1]””,““det(b)””],““precision””: 14}“”
Method : POST

Expected Response :
{
“result”:[
“7.8”,
“3.9”,
“2 inch”,
“0.5”,
“3+2i”,
“[[-1,2],[3,1]]”,
“-7”
],
“error”:null
}

Actual Response;

\n\n\n\nError\n\n\n
Internal Server Error
\n\n

I would like to know if I am making any mistake. Kindly help me here.

1 Like

Updating the screenshot of actual response.

image

pls try below -

  • create a strBody string variable
  • assign inout request jain to the strBody
  • pls remove input request from http request activity
  • add the strBody variable to Body Property in HttpRequest and verify.
1 Like

Hi @GBK,

Can you please explain me clearly. Am a beginner and trying to get into things. Please do correct my mistakes.

Regards,
Dinesh

pls try below -

  • create a variable in your sequence name like a strBody
  • using assign activity- assign the ‘Request’ (mentioned in the post) text to the variable strBody
  • add the strBody variable to Body Property in HttpRequest
  • Execute and verify
2 Likes

Hey @GBK,

That worked awesome. Thank you so much.

Regards,
Dinesh

cheers! pls mark reply as solution and this post will close in 3 days.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.