parsing response header on rest model insert (POST)

  • 1
  • Question
  • Updated 2 years ago
I have a response to a REST model POST action that looks like this:
  "statusCode": 201,
  "status": "Created",
  "setCookies": null,
  "headers": {
    "Location": "https:\/\/\/v2\/customers\/41563X46EXC15DA3C39F70",
    "Content-Type": "application\/json; charset=UTF-8",
    "Date": "Wed, 02 Aug 2017 16:24:52 GMT",
    "Content-Language": "en-US",
    "Content-Length": "0",
    "Expires": "Fri, 01 Jan 1990 00:00:00 GMT",
    "Pragma": "no-cache",
    "Cache-Control": "private, max-age=0, no-cache, no-store",
    "X-Frame-Options": "SAMEORIGIN"
  "error": null,
  "body": "" 

The Id for the newly created row is after the final slash in the "Location" header. How can I communicate that to the model?
Photo of Matt Sones

Matt Sones, Champion

  • 31,986 Points 20k badge 2x thumb

Posted 2 years ago

  • 1

Be the first to post a reply!