0
Under review

http web request post error

Anonymous 1 month ago in Studio • updated by Michael 4 weeks ago 9

Hi Warewolf-Team,

yeah sure, I have an problem with the HTTP Web Request Post. I only got an 400 Error. I want to send a body with json content. This should be possible, I think?

For some cases I need patch request to. Is this planed for the next time?

Under review

Hi,

Thanks for the question. Can you please provide us with the following information (if possible):

  1. The URL you are posting to
  2. The actual content you are posting
  3. Any headers that you are passing/need to pass

Also a screen shot of the tool open in large view (double click the title bar of the tool or right-click in the title bar and click 'Show Large View').

Thanks

  1. Thats just a local instance of the Shopware API -> http://shopware/api/articles/
  2. body.json I tested this on some other API tools and it works great. 
  3. Header:
    1. Content-Type: application/json
    2. Authorization: Basic *Key*

Hi Michael,

Under 'Headers' section, I can't see if you have the Content-Type header. If you don't have it can you please add it, and then try it out.

Thanks

Hi, 

sorry, the view is to small. But the Content-Type ist set to application/json.

Thanks.

Hi Michael,

Can you confirm if the GET call to that API works? Unfortunately without being able to actually execute against the API from our side it's difficult to determine where the issue is coming from. Alternatively we could setup a TeamView session to try resolve this?


Thanks 

Yes, there are no problems with the GET call. Now I think I found the issue. In the description value are some letters like ä, ü, ö and so on. 

Do you know, how I can fix this? 

Thanks!

You could try escaping them. Alternatively if you leave those special characters out of the payload, does the request work?

Without the special characters, it works great. But I can't let them out.
I tried to escape them with unicode. So for example the ä = \u00c4. When I debug the workflow in the browser, it looks perfect. The problem now is, that warewolf saves not the unicode in the variable. The output file only contains characters like "ä" instead of \u00c4.

For replacing it, I used the JS module.

JS code: json = json.replace(/ä/g, '\u00e4');
I have tested the code with some other strings.

Do you have any other idea, how to solve the problem?

Thanks

Which encoding do Warewolf use?