question

Teodor Plop avatar image
Teodor Plop asked

Azure Table Storage POST

Hi there!

I can successfully send GET request types to azure table storage, by using http.request method. I am trying to make a POST request, but it does not work, as it tells me my authorization header is incorrect.

I am using the same code and I actually tested by generating the same authorization key as on Postman (where it works) and failed.

Can anyone help with this? You can also have a look at the code, title DDEE0. I am calling "handlers.AzureRequest" function from Scheduled Tasks

Cheers!

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Teodor Plop avatar image
Teodor Plop answered

I managed to successfully authorize POST requests by using Shared Lite authorization.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sarah Zhang avatar image
Sarah Zhang answered

Refer to this reply, a possible reason that causes Authorization header incorrect is the http library's interpretation of the authorization header is following a strict version of the http spec. It means you need to insert spaces in the actual header value:

var headers = { 
"Authorization": "key = AAAAi4E..." 
};

On the line 83 of your code, there is no a space after the colon. You can try to check it.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Teodor Plop avatar image Teodor Plop commented ·

Hmm, that's interesting. I tried it and received the error:

"Authentication information is not given in the correct format. Check the value of Authorization header."

0 Likes 0 ·
Teodor Plop avatar image Teodor Plop commented ·

On a quick note, the GET requests work flawlessly without any spaces, and stop working if I add spaces. So I think there might be something related to the POST requests?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.