Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] JSON with HTTP POST

Hello,
newly I have heard of the JSON Script. Now I should do a JSON request over HTTP POST.
I have tried tHTTPRequest, tRest but without any success.
With tHTTPRequest I get the answer from the Server "415 Unsupported Media Type" that is way I am thinkg I do have the wrong syntax.
The Server just need my login data, like
"AuthenticationTO:
{
"username":"XXXXXX@XXX",
"password":"XXXXXXXXXXX"
}"
and it should give me data in JSON back.
Can someone please show me how to configure tHTTPRequest or which Job ever is best for it.
Hope this is understandable. Feel free to ask.
Regards,
Franzi
Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Finally I found the problems.
1. what archenroot had allready said
custom header with tHttpRequest:
header value
Content-type application/json
2. wrong json file
the file content should looks like:
{
"username":"xxx",
"password":"xxx"
}
then it works.
Regrads Franzi

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Try to configure custom header with tHttpRequest:
header          value
Content-type application/json
Anonymous
Not applicable
Author

Hello archenroot,
thanks for your response, not sure if I understand you right. Because I just get even more errors.
My tHttpRequest looks like the following (some issues just circumscribed do to corporate secret)
Property: Built-In
URI: URL from where to get the data
Method: POST
Post parameters from file: ".../authentification.json" (do not know what to do with it, or better how this file should looks like)
"tick" Write response content to file: ".../response.json" (empty file)
Headers: value:
Content-type application/json
"untick" Need authentification (tried to get the authentification data via the file)
- have also tried it tick and without an file, but that also does not work

Authentification file:
{
"username":"xxx",
"password":"xxx"
}

What am I doing wrong?
Greetings Franzi
Anonymous
Not applicable
Author

Finally I found the problems.
1. what archenroot had allready said
custom header with tHttpRequest:
header value
Content-type application/json
2. wrong json file
the file content should looks like:
{
"username":"xxx",
"password":"xxx"
}
then it works.
Regrads Franzi