Как назвать “CreateFile” в C#?

HTTParty.get возвращает инкапсулированный тип ответа класса HTTParty::Response, вам нужно извлечь parsed response из этого с помощью:

response = HTTParty.get(
  'http://codekyt.in/froodle-wp/wp-json/data/v2/projects?client_key=12345',
  :headers =>{'Content-Type' => 'application/json'}
)
@category = response.parsed_response # this will return the json.

Также вам не нужно повторять @category в В вашем случае объект json является единственным, и вы можете использовать его напрямую:

<%=@category["restaurant_name"]%>
<%=@category["country"]%>
<%=@category["currency"]%>
<%=@category["usd"]%>
<%=@category["client_key"]%>
<%=@category["client_name"]%>
<%=@category["client_email"]%>
<%=@category["client_phone"]%>
<%=@category["product_tier"]%>
<%=@category["brand_logo_large"]%>
9
задан Community 23 May 2017 в 10:29
поделиться

1 ответ

[DllImport("kernel32.dll", CharSet = CharSet.Auto, 
    CallingConvention = CallingConvention.StdCall, 
    SetLastError = true)]
public static extern SafeFileHandle CreateFile(
    string lpFileName,
    uint dwDesiredAccess,
    uint dwShareMode,
    IntPtr SecurityAttributes,
    uint dwCreationDisposition,
    uint dwFlagsAndAttributes,
    IntPtr hTemplateFile
);

http://pinvoke.net/default.aspx/kernel32/CreateFile.html

19
ответ дан 4 December 2019 в 11:08
поделиться
Другие вопросы по тегам:

Похожие вопросы: