AnsweredAssumed Answered

400 Bad Request POSTing with C# client

Question asked by Brendon Kellett on Jun 16, 2017
Latest reply on Jun 19, 2017 by Brendon Kellett

Hi. I'm attempting to make use of the C# OPEN client (GitHub - akamai/AkamaiOPEN-edgegrid-C-Sharp ), and I can GET data just fine, but I'm getting 400 responses for anything with a body (POST, PUT).

 

Here is a sanitised example of the request I am attempting:

 

POST https://akab-xxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx.luna.akamaiapis.net/config-media-live/v1/live/v6demolive-lh.akamaihd.net/stream
ClientToken: akab-wvbguae3ye5iqojx-o5xdspi6oesnqnqx
AccessToken: akab-******************-xxxxxxxxxxxxxxxxxxxx
Secret: ***************************************=
Data: [<?xml version="1.0" encoding="UTF-16" standalone="yes"?>
<stream>
  <stream-type>Universal Streaming Live</stream-type>
  <stream-name>Test</stream-name>
  <primary-contact-name>xxxxxxxx</primary-contact-name>
  <secondary-contact-name>xxxxxxxx</secondary-contact-name>
  <status>Provisioned</status>
  <notification-email>xxxxx@******.com</notification-email>
  <encoder-settings>
    <primary-encoder-ip>174.224.224.224</primary-encoder-ip>
    <backup-encoder-ip>174.224.224.224</backup-encoder-ip>
    <username>194083</username>
    <password>b11gb</password>
  </encoder-settings>
  <dvr-settings>
    <dvr>Disabled</dvr>
  </dvr-settings>
  <security-1.0>
    <token-authorization>Disabled</token-authorization>
    <player-verification>Disabled</player-verification>
  </security-1.0>
</stream>]
OutputFile: akamai.xml
Content-Type: application/xml
Authorization: EG1-HMAC-SHA256 client_token=akab-wvbguae3ye5iqojx-o5xdspi6oesnqnqx;access_token=akab-xxxxxxxxxxxxx-******************;timestamp=20170616T06:08:41+0000;nonce=6c57f7e2-285d-492c-9e71-4dd502370575;signature=YxaJgruYzaQCpC6Nelv3Jp+MxCURvtCg75ZpG1qCQug=

 

Response:


Unhandled Exception: System.Net.Http.HttpRequestException: Unexpected Response from Server: BadRequest Bad Request
Connection: close
Content-Length: 427
Content-Type: application/problem+json
Date: Fri, 16 Jun 2017 06:08:41 GMT

 

{
  "type": "https://problems.luna.akamaiapis.net/-/resource-impl/forward-origin-error",
  "title": "Bad Request",
  "status": 400,
  "instance": "https://akab-***************-*********************.luna.akamaiapis.net/config-media-live/v1/live/v6demolive-lh.akamaihd.net/stream",
  "method": "POST",
  "serverIp": "23.***.xx.***",
  "clientIp": "180.***.xx.***",
  "requestId": "3da9580",
  "requestTime": "2017-06-16T06:08:41Z"
}

 

I have tried different XML payloads including simply modifying a response from /config-media-live/v1/live/v6demolive-lh.akamaihd.net/stream/<id>, but all with the exact same response.  Please help me understand how I can debug this.

 

Cheers.

Outcomes