help with complicated post data



  • i keep getting errors about a missing body when posting this data to my target.

    [{"operationName":"GetCoreProfile","variables":{"userId":40345597},"query":"query GetCoreProfile($userId: Long) {\n  findProfile(id: $userId) {\n    ...CoreProfile\n    __typename\n  }\n}\n\nfragment CoreProfile on Profile {\n  companyName\n  displayName\n  id\n  isAdmarkt\n  isReadIndicatorEnabled\n  isSfidEnabled\n  memberSince\n  photoUrl\n  profileName\n  profileType\n  __typename\n}\n"},{"operationName":"getSearchCategories","variables":{"selectedId":null,"locale":"en-CA"},"query":"query getSearchCategories($locale: String!, $selectedId: Int) {\n  searchCategories(selectedId: $selectedId) {\n    id\n    localizedName(locale: $locale)\n    l1Category {\n      id\n      __typename\n    }\n    __typename\n  }\n}\n"},{"operationName":"GetNewNotificationCount","variables":{"userId":40345597,"limit":0},"query":"query GetNewNotificationCount($userId: Int!, $limit: Int) {\n  notifications(limit: $limit, userId: $userId) {\n    newCount\n    __typename\n  }\n}\n"},{"operationName":"GetProfile","variables":{"includePaypalLinkedData":true,"userId":40345597},"query":"query GetProfile($userId: Long, $includePaypalLinkedData: Boolean = false) {\n  findProfile(id: $userId) {\n    ...CoreProfile\n    isLinkedToPaypal @include(if: $includePaypalLinkedData)\n    numberOfOrganicAds\n    responsiveness\n    replyRate\n    __typename\n  }\n}\n\nfragment CoreProfile on Profile {\n  companyName\n  displayName\n  id\n  isAdmarkt\n  isReadIndicatorEnabled\n  isSfidEnabled\n  memberSince\n  photoUrl\n  profileName\n  profileType\n  __typename\n}\n"},{"operationName":"GetReviewSummary","variables":{"userId":40345597},"query":"query GetReviewSummary($userId: Int!) {\n  reviewSummary(userId: $userId) {\n    sumScore\n    totalReviews\n    __typename\n  }\n}\n"},{"operationName":"GetUserProfileListingData","variables":{"userId":40345597,"searchParams":{"sort":"sorting_date","sortAscending":false,"page":0,"locale":"en-CA"}},"query":"query GetUserProfileListingData($searchParams: ItemSearchOptions, $userId: Int!) {\n  listings(searchParams: $searchParams) {\n    forUser(userId: $userId) {\n      items {\n        id\n        source\n        type\n        hasCarproof\n        images {\n          imageUrl\n          __typename\n        }\n        isDisplayPriceDrop\n        isPriceEnabled\n        isVeteranFriendly\n        location {\n          latitude\n          longitude\n          name\n          __typename\n        }\n        originalPrice {\n          amount\n          type\n          __typename\n        }\n        sortingDate\n        title\n        description\n        price {\n          amount\n          type\n          __typename\n        }\n        __typename\n      }\n      totals {\n        ORGANIC\n        __typename\n      }\n      __typename\n    }\n    __typename\n  }\n}\n"}]
    

    any solutions? this is VERY Important.



  • this is the error

    POST body missing. Did you forget use body-parser middleware?



  • @Ruri by any chance can you help?



  • ok so that err was cause of content type, changed to proper one an hit new err, ‘Bad Request’ is there something wrong with the data?



  • Are you sure you're using the right Content-Type?


  • Donator

    did you replace every \n with \\n? i had the same issue with post data that used the newline break needed to replace them with \\n and it worked



  • Instead of using "\n" I use this handy site.

    https://tools.knowledgewalls.com/online-multiline-to-single-line-converter

    Just paste your unformatted POST data and convert it! Never has done me wrong


Log in to reply