Unable to read json request payload

Anybody know why I am getting this error message:
image

Note this error occurs from a library activity therefore the code for the actual activity need not be changed - I believe an activity before this will recitfy the issue. I have tried deserialize json but I cannot use the output of that activity.

Please ensure Content-Type header is set and payload is of valid JSON format," typically occurs when a web request expects a JSON payload, but the payload is either not in JSON format or the Content-Type header is not correctly set.

steps

1.Check the Request Headers: Ensure that the Content-Type header in your HTTP request is set to application/json. This tells the server that you’re sending JSON data.
2.Validate JSON Format:Double-check that the JSON payload you are sending is in a valid JSON format. Even a small syntax error can cause this issue. You can use an online JSON validator to check the format.
3.Use Deserialize JSON Activity:You mentioned you’ve tried using the Deserialize JSON activity. If the response is indeed valid JSON, this activity should work. Make sure you are providing it with the correct input, which should be the HTTP response content.
4.Log the Payload:Add a log message activity to log the content of the payload before making the HTTP request. This way, you can verify that you are sending the expected JSON data.

@E.T.S

Change the Content-Type header in your HTTP request is set to "application/json"

Check once running in different api platform like postman

I feel like the JSON payload is missing a required field or JSON payload contains an invalid value

Check with its parameter as well

Cheers @E.T.S

@E.T.S

As per error looks like the json pay load that you are sending is not in correct format or is not in expected format…please check the same

cheers

I am unsure what content type header and Json payload is

Would the output of the Deserialize activity go into setting the arguments? I am unsure how to obtain the HTTP request

I am unsure what the content type header is

working with HTTP requests and JSON payloads. Let’s clarify

1.Content-Type Header:The Content-Type header is part of an HTTP request. It specifies the media type of the resource being sent to the server. When sending JSON data to a server, you should include this header to indicate that the content of the request is in JSON format. The value of this header should be set to "application/json".
2.JSON Payload:The JSON payload is the actual data you want to send to the server. In the context of a web request, it means the JSON data that you’re transmitting to the server. JSON is a data format that’s easy for both humans and machines to read. JSON payloads are typically used in POST or PUT requests to send data to the server.
3.Deserialize JSON Activity:This activity is used to convert a JSON string (e.g., the response content from a web request) into a .NET object. It’s generally used for processing JSON responses received from a web service. The output of this activity will be an object that you can work with in your workflow. You can use this output to extract specific values from the JSON response.

@E.T.S

1 Like

U r passing Json as payload so obviously if this Json type
Change the Content-Type header in your HTTP request is set to "application/json"

U can add this or modify the value of this in header section
@E.T.S

1 Like

Please can you clarify where the header section is in an activity/ flow @Palaniyappan

Hope u r using some api activity
There u can see this option
@E.T.S

1 Like

These are the options in the activity:

@Palaniyappan

Use headers property @E.T.S

1 Like

Managed to sort it - one of the variables was set up incorrectly

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