Content-Type application/json

Amanprit Sahota 0 Reputation points
2023-11-21T13:49:47.9033333+00:00

body of get request.jpg

web activity output.jpgI'm using a Web activity to do a GET request from a API.

In the header I have put in Content-Type and value application/json.

The json request body starts with a hard bracket and ends with a bracket ( see picture).

When I look in the output of the Web activity the Content-Type is "Content-Type": "text/plain; charset=utf-8"(see picture)

I was hoping for application/json but instead it's giving me it as a text/string

How can I get it out as a json into a variable. I'm trying to get the lastPage number

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,121 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 19,616 Reputation points
    2023-11-21T21:23:44.8033333+00:00

    If you are able to use a Data Flow activity, go ahead. You can use aderived column to parse the string into a JSON object with an expression like fromJSON() or similar to parse the string into a JSON object.

    Once you have the JSON object, you can extract the lastPage number by accessing the appropriate key in the JSON structure. You'll need to know the exact structure of your JSON response to do this correctly.

    If the newlines (\n) and escaped characters (\) are causing issues in parsing, you might need to use string manipulation functions in your Derived Column transformation to clean up the response before parsing it as JSON.

    0 comments No comments